Prothon gets Major Facelift in Vers 0.1.0 [Prothon]
Robin Becker
robin at SPAMREMOVEjessikat.fsnet.co.uk
Tue May 25 14:48:18 EDT 2004
Jacek Generowicz wrote:
........
>
> Looks like compiling this partucular high-level dynamically typed
> language makes it run considerably faster. Let's repeat the exercise
> for 3 more implementations of this particular language I just happen
> to have lying around on my machine, and compare it to Python's
> performance on the equivalent program:
>
>
>>>>def fib(n):
>
> ... if n<2: return 1
> ... return fib(n-1) + fib(n-2)
> ...
>
>>>>import time
>>>>a=time.time(); fib(35); time.time() - a
>
> 14930352
> 20.425565958023071
>
>
> Here are the results gathered in a table:
>
>
> Name Interpreted Compiled
>
> LispWorks 66 1.0 s
> Clisp 41 9.5 s
> CMUCL Got bored waiting 1.5 s
> SBCL Compiles everything 1.6 s
> Python Compiles everything 20 s
>
>
> So, we have times of 1.0s, 1.5s, 1.6s, 9.5s and 20s. Now one of those
> Common Lisp implementations does NOT compile to native; it compiles to
> bytecode. Can you guess which one it is, by looking at the timings ?
I tried a modification in prothon and was suprised at how bad it was. My
windows box started to thrash with fib(35) so I reduced it to fib(25)
#fib.py
def fib(n):
if n<2: return 1
return fib(n-1) + fib(n-2)
print fib(25)
C:\Prothon\pr\test>timethis \Prothon\prothon fib.py
TimeThis : Command Line : \Prothon\prothon fib.py
TimeThis : Start Time : Tue May 25 19:41:32 2004
121393
TimeThis : Command Line : \Prothon\prothon fib.py
TimeThis : Start Time : Tue May 25 19:41:32 2004
TimeThis : End Time : Tue May 25 19:42:24 2004
TimeThis : Elapsed Time : 00:00:52.235
compare with
C:\Prothon\pr\test>timethis python fib.py
TimeThis : Command Line : python fib.py
TimeThis : Start Time : Tue May 25 19:43:02 2004
121393
TimeThis : Command Line : python fib.py
TimeThis : Start Time : Tue May 25 19:43:02 2004
TimeThis : End Time : Tue May 25 19:43:05 2004
TimeThis : Elapsed Time : 00:00:02.673
In fact the python time for fib(35) was about 31.1 seconds (ie less than
prothon for fib(25)) so something is spectacularly amiss with prothon.
--
Robin Becker
More information about the Python-list
mailing list