4 ms·
PyPy does have a few knobs to tune, but they're not very often used (they're nicely documented, however mostly in the source code, I'll try to pull say GC param
by fijal 14y ago
PyPy does have a few knobs to tune, but they're not very often used (they're nicely documented, however mostly in the source code, I'll try to pull say GC parameters more prominently in the docs).
However, the way you write python code can be tuned a lot. This is actually, at least to an extend, our failure. JIT can make things really fast, but can get confused in places. We're trying to eliminate them as we go, but it can't be always done.
Generators vs list comprehensions. Not using sys._getframe, sys.exc_info, etc. not relying too much on dynamism like passing very general kwargs and *args, the list goes on.
Jitviewer can be a lot of help, but it's a bit buggy and too low level to be seriously recommended.
- ak217 14y ago> Generators vs list comprehensions I'm a bit confused. Which one is faster?
- robert-zaremba 14y agolist comprehensions of course!
- signed0 14y agoThe exclamation led me to believe you were being facetious, but https://bitbucket.org/pypy/pypy/wiki/JitFriendliness https://bitbucket.org/pypy/pypy/wiki/JitFriendliness agrees with you: "As of now (Feb 2011) generators are usually slower than corresponding code not using generators. Same goes for generator expressions. For most cases using list comprehension is faster."