Great. Let’s include this link in Alex’s write up as an example of a concrete 
comparison. Even if such simple benchmarks don’t reflect daily, end-to-end 
programs, they can help people by dispelling some prejudices. Thanks — Matthias



> On Feb 4, 2019, at 11:56 AM, Gustavo Massaccesi <[email protected]> wrote:
> 
> For some reason, the Racket vs Python performance is a question that arise 
> from time to time in Hacke News (like 2 or 3 times per year). Last time I 
> asked if it was possible to add a direct comparison in The Computer Language 
> Benchmarks Game and the owner/maintainer added that page. The results are in 
> https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/racket-python3.html
>  [Standard disclaimer: The results change from program to program, so take 
> this comparison only as a guide.]
> 
> A short version of the results is that:
> * in 6 of the programs Racket is much faster
> * in 1 of the programs Racket is faster
> * in 2 of the programs there is almost a tie
> * in 1 of the programs Racket is slower
> 
> Some programs in Racket need parallelization, so the results may improve in 
> the future. [I didn't look too carefully at the programs in Python.]
> 
> My unofficial takeaway, not completely backed by the benchmarks, is that
> * For numeric programs Racket is (may be) 5 to 20 times faster than Python
> * For programs with too many stings and hashes, the speed is almost the same.
> 
> 
> 
> Also, there was an old thread about translating the classic Norvig's spelling 
> correction from Python to Racket, without changing the structure of the 
> implementation too much and using idiomatic code.
> https://groups.google.com/forum/#!topic/racket-users/u0Ua1kTUSKw After a few 
> attempts, the final version in Racket was a 30% slower. I didn't follow this 
> too much after the discussion, so I don't know if there is a smaller or 
> bigger difference using the current versions. (Also, I think we never tried 
> to make is fast as possible, with the same algorithms, but changing the 
> implementation as much as it was necessary.)
> 
> Gustavo
> 
> On Sun, Feb 3, 2019 at 7:38 PM Matthias Felleisen <[email protected]> 
> wrote:
> 
> Agreed! 
> 
> 
> 
>> On Feb 3, 2019, at 4:43 PM, Robby Findler <[email protected]> 
>> wrote:
>> 
>> It seems like a great addition to the performance section of the guide. 
>> 
>> Robby 
>> 
>> On Sun, Feb 3, 2019 at 3:35 PM Matthias Felleisen <[email protected]> 
>> wrote:
>> 
>> 1. I think this is a great start for a generic introduction to data 
>> structures. Someone should integrate Jens’s short table: 
>> 
>>  
>> https://stackoverflow.com/questions/27584416/in-racket-what-is-the-advantage-of-lists-over-vectors/27589146#27589146
>>  
>> 
>> 
>> 2. I think language-to-language documents serve a different role, but your 
>> document could be cited from there. 
>> 
>> The point of say “From Python to Racket” would be to show how comprehensions 
>> translate or how classes work 1-1. And yes, it would also explain that 
>> Racket calls something a list that does __not___ at all correspond to a 
>> list. 
>> 
>> The corresponding Java write-up would be quite different again. In that 
>> case, we would be dealing with people who might not know more than classes 
>> and methods. But they might actually know proper design and might know that 
>> it calls for recursion (hidden in classes and interfaces). In Racket, that 
>> works even better than in Java. Plus it would need to say something brief 
>> about types. 
>> 
>> And R would be an entirely different story. 
>> 
>> — Matthias
>> 
>> 
>> 
>> 
>> 
>>> On Feb 2, 2019, at 11:37 PM, Alex Harsanyi <[email protected]> wrote:
>>> 
>>> 
>>> I put together some notes about available data structures in Racket, with 
>>> some performance considerations.  It needs more work, but perhaps it can be 
>>> used as a starting point and it can be added to the Racket wiki, if/when 
>>> others consider it adequate:
>>> 
>>> https://gist.github.com/alex-hhh/3cc5690a7f9c74543dab6c11344e6202
>>> 
>>> I didn't write a "Python to Racket" guide, because I don't really know 
>>> enough about Python to write such a document, and I also think that a more 
>>> generic document is simpler to maintain and can be used by people who come 
>>> from other languages as well.
>>> 
>>> I also tried to keep the document short, the aim being to provide a 
>>> competent programmer who is new to Racket with a 5 minute overview to its 
>>> data structures and some links to the starting points in the documentation. 
>>>  We can add things to it, but I think it is better to keep it short rather 
>>> than comprehensive in this case -- after all, there is the Racket Guide and 
>>> Racket Reference and these documents contain all the details.  Perhaps new 
>>> documents can be added to the wiki, exploring other topics in more detail.
>>> 
>>> I did not mention `ralist` because (1) I have no experience with it, but 
>>> more importantly (2) the package is not part of the Racket distribution and 
>>> has to be installed separately.  I don't it reflects well on Racket if we 
>>> tell people to install a separate package if they want an efficient 
>>> container...  I have no experience with `ralist`, but if it is indeed a 
>>> good data structure and it has a potentially wide usage, it should be 
>>> included in the default Racket installation.
>>> 
>>> Alex.
>>> 
>>> On Sunday, February 3, 2019 at 7:00:10 AM UTC+8, Matthias Felleisen wrote:
>>> 
>>> 
>>> Racket needs *you*. Please. 
>>> 
>>> The proper approach is to have short pages for different language 
>>> immigration groups: Python and R come to mind as obvious examples but I am 
>>> sure there are others. 
>>> 
>>> What I mean is we need help and *you* can help. Let me explain it with the 
>>> Python example: 
>>> 
>>> 1. Set up a page (wiki?) called “From Python to Racket” 
>>> 
>>> 2. Create two sections that are immediately visible from the top: 
>>>          
>>>         — idioms 
>>>         — performance pitfalls 
>>> 
>>> 3. In the specific case of Python, the second subsection needs to start 
>>> with a subsection on 
>>> 
>>>         — Python Lists aren’t Racket Lists 
>>>         — then point to data/ralis and show how to transliterate the 
>>> loop/append example like this 
>>>         — optionally also show the more native Racket idiom 
>>> 
>>> 4. When anyone observers another blog/social media/whatever post on Racket 
>>> is slow because I come from Python, 
>>> 
>>>         (a) point the posters to the page  or 
>>>         (b) if it is a new case, write a section for this example then do 
>>> (a) 
>>> 
>>> 
>>> If you want to help advertise Racket to others, this is an excellent way of 
>>> helping out. 
>>> 
>>> Thanks — Matthias 
>>> 
>>> [[ p.s. For my very first Python program (a couple of days before meeting 
>>> with GvR), I used Python’s append and was annoyed beyond belief. ]] 
>>> 
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to