On 5/10/05, Tim Starling <t.starling(a)physics.unimelb.edu.au> wrote:
So don't tell me interpreted languages
are getting faster, they're as slow as the day they were invented. If
you need to execute large numbers of calls to short-running functions,
you're sunk.
I've had some good experience with Python+Psyco. Psyco can deliver
excellent performance boosts for tight loops doing simple operations
on numbers and strings, and does a good job with function calls.
Using your example, I just timed incrementing an integer variable 10^9
times to 113 seconds with plain Python and 2.35 seconds with Psyco.
In the benchmarks at The Great Computer Language Shootout [1],
Python+Psyco is about 5x faster than PHP. It is within 1/10x the speed
of C/gcc for most benchmarks. (The worst case, n-body simulation, is
85 times slower than C. However, I tried a trivial optimization for
the inner loop and it got twice as fast :-)
[1]
http://shootout.alioth.debian.org/great/benchmark.php?test=all&lang=psy…
Fredrik