3 ms·
Interesting enough, but kinda predictable. I ran most of the tests using PyPy 2.7 on OS X for fun. As expected PyPy performed vastly better in almost all tests,
by scandinavian 11y ago
Interesting enough, but kinda predictable. I ran most of the tests using PyPy 2.7 on OS X for fun. As expected PyPy performed vastly better in almost all tests, as they are all loop heavy, so the JIT can get to work.
As an example, for the first test I got:
pypy test.py 1000000000 1.01s user 0.03s system 99% cpu 1.042 total
python test.py 55000000 1.02s user 0.01s system 99% cpu 1.038 total
So about 18 times faster. On most tests PyPy was 3-10 times faster than cPython. So what does this tell us? Nothing really, the benchmarks are not really indicative of anything you would do with Python. Oh, and PyPy is very fast at some stuff.
- rockmeamedee 11y agoI don't think they're benchmarks though. I think the great part about this piece is that it gives people more intuition about computer speeds in specific use cases to identify bottlenecks better. If you have a complex operation like serving a web page, and you measure each part of the process, this page gives you a feel for what the ideal cases of file IO, memory access, computation, serialization and network access are so you can sort of tell what to fix a lot faster. Essentially a broader version of Numbers Every Computer Programmer Should Know.
- collinmanderson 11y agopypy fixes python's slow class instantiation. The HTTPRequest request parsing is probably much faster on pypy because it creates a new class within the loop.