PyPy 2.0 Released
morepypy.blogspot.com
morepypy.blogspot.com
Specifically:
* PyPy Dict performance is very slow (slower than Cpython). A lot of the code I need to write that is cpu-intensive python code processes data (from stuff like logs) into various data structures that use dicts. Pypy is rarely more than 10% faster and sometimes slower.
* The memory management/GC can be bad. I've seen the same code that runs fine on cpython end up using excessive amounts of memory (and causing out of memory issues etc) with PyPy. Again - this is normally involving complicated data-structures.
On about 10 occasions now I've had CPU bound Python tasks, then I've tried to use with PyPy and never had > 20% performance improvements. Which is a big contrast with the benchmarks.
Is it just me? Or have other people had similar experiences?
[edit: typos]
The interpreter is slower than the CPython one. For code which doesn't JIT well, it will go slower with pypy. The firefox JS engine now has a fast interpreter, a quick JIT, and a more optimizing one. This means the baseline performance is better in CPython, so if pypy manages to make their interpreter better baseline performance will get better.
The memory management in CPython is much more predictable and deterministic since it is using reference counting and not GC. The pypy GC may be faster in many circumstances however. IO in pypy can be slower sometimes if the GC is unhappy with the way you're doing it. Especially if you're leaving files open, or reading in different sized chunks of data.
The new pypy release speeds up a few different types of real world code however. XML processing, DB processing, and stackless async code (eventlet, and greenlet) are three areas where pypy has improved with this release. Numpy based code is another area where pypy has gotten better with this release.
In short, pypy still has many areas where it could improve... but with each release is getting better at more types of real code :)
For run-once, and latency or memory sensitive code the benchmarks may be a bit misleading.
Huh?
- interpreted
- If run 'enough' times, the code is JIT compiled (fast compilation)
- If run 'enough' times again, it is JIT compiled with the most optimizing compiler (slow compilation)
http://rz.scale-it.pl/2013/02/18/wikipedia_processing._PyPy_...
Also I'm using it with my web applications.
That doesn't change how the PyPy project tends to represent itself, which almost always comes across as something like "6x speedup for everything (excluding JIT warmup)". If you want everyone to adopt PyPy instead of CPython then it is part of your job to find the cases where PyPy is not actually faster rather than saying it is the user's fault. And it is not your job to select only benchmarks which tell the story you want.
If the difference between interpreters is nuanced then that nuance should be expressed so that people can make intelligent decisions rather than dismissing one or another interpreter as "slow".
One of the things that kept me on Perl was its great performance.
http://benchmarksgame.alioth.debian.org/u64q/perl.php
I'd like to go for the win, win. Is that 'FTWW?'
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
So CPython is about the same speed as Perl. PyPy's speed comparison suggests that PyPy is 2-20x faster than CPython. What else do you want to know?
Perl, btw, is not noted for its "great performance" in any context I've ever heard of.
http://stackoverflow.com/questions/12793562/text-processing-...
These days, however, it appears that Python has really come into its own. I started using Sublime Text so that got me into trying out Python.
Of all the common scripting languages I think TCL uses a different algorithm for regex matching and is considerably faster than Perl, especially on longer strings. Let me find some corroborating docs.
Ok this has some info http://swtch.com/~rsc/regexp/regexp1.html
I love vim, but jesus I can never remember which vim regex metacharacters need escaping to get their meta-meaning, and which need escaping to get their non-meta meaning.
I dunno, I haven't used it in the past, because...
1) "It is recommended to always keep the 'magic' option at the default setting, which is 'magic'. This avoids portability problems."
2) Nor do I want to type two extra characters in every damn regex!
So, it only occurs to me right now, the right thing to do for me is this: the first instant I'm confused about whether \( means grouping or literal paren, I should immediately start my pattern with \v or \V. No unportability of plugins, no marginal cost on regexes that don't care, marginal benefit when it does matter.
1. web frameworks performance: http://mindref.blogspot.com/2012/09/python-fastest-web-frame... 2. template engine performance: http://mindref.blogspot.com/2012/07/python-fastest-template....
It would be interesting to see how PyPy 1.9 compares to 2.0 in those benchmarks.
http://tratt.net/laurie/research/pubs/files/metatracing_vms/
Cross-langauge benchmarks are inevitably synthetic, and synthetic benchmarks can only tell you so much. It's important not to over-interpret them. But they can give you a rough idea of what's going on, at least in some circumstances. If someone wanted to add Perl to the experiment set, I'd gladly accept a patch to the benchmarking suite.Excellent work, fijal and team!
PyPy on the other hand is simply a fast Python interpreter. Not sure what you mean regarding the type information gathered by the JIT.
Looking forward to the day PyPy becomes the reference implementation.
Pypy should stay as it is, an experiment that can be used for people who require more performance for certain workloads. Of course, having part of your language written in C for CPython can hurt sometimes, when you can't easily use the functionality on other interpreters.
They already did that.
Actually, I'd like it if somebody hacked up a very very simple and naive Python interpreter and nominated that for the reference implementation instead.
I have not read large amounts of it, but the interpreter is written in RPython. Surely it's easier to read than the CPython source?
When I tried the beta, it was crashy, but 2.0 seems pretty good so far.