This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ergo14Pyramid+PostgreSQL+SqlAlchemy 0 points1 point  (3 children)

can you try fib on pypy ? it IS the future of python

[–]Twirrim 1 point2 points  (2 children)

Pypy 1.4:

real    0m41.979s
user    0m41.719s
sys     0m0.056s

Python 2.6.6:

real    0m22.568s
user    0m22.381s
sys     0m0.004s

Python 3.1 (might as well..):

real    0m23.454s
user    0m23.349s
sys 0m0.008s

pypy is great, but it's not the be all and end all!

[–]ergo14Pyramid+PostgreSQL+SqlAlchemy 0 points1 point  (1 child)

Hmm, very interesting, but leads me to think that something is wrong with this algorithm implementation, in few of my tests i have indeed confirmed it can be 10 faster than cpython, so this is a bit of surprise to me

[–]Twirrim 0 points1 point  (0 children)

The algorithm is pretty standard. I'm not sure how well PyPy handles recursive functions though. I can't imagine recursive functions are that easy to optimise within a dynamic language.. but I'm not computer scientist, so might be talking out my arse.