How to make Python run as fast (or faster) than Julia

Chris Angelico rosuav at gmail.com
Thu Feb 22 13:43:16 EST 2018


On Fri, Feb 23, 2018 at 12:51 AM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> 22.02.18 14:29, Chris Angelico пише:
>>
>> Not overly misleading; the point of it is to show how trivially easy
>> it is to memoize a function in Python. For a fair comparison, I'd like
>> to see the equivalent Julia code: the function, unchanged, with
>> something around the outside of it to manage caching and memoization.
>> Can that be done with a couple of trivial lines of code using only the
>> standard library?
>
>
> The article contains a reference to a Julia example.
>
>> Note that Julia also can memoize functions, see this example [1] provided
>> by Ismael V.C.
> [1] http://nbviewer.jupyter.org/gist/Ismael-VC/b04ad17ee44c89917803
>

Yep, but I don't know Julia enough to know if that's the standard
library, and there aren't timings for it (which also makes it harder
to skim for - I missed it on first read, and only found it when I
searched the page for 'memoize'). If that's standard library, my
conclusion would be "Winner: Tie".

ChrisA



More information about the Python-list mailing list