4 ms·
> It’s fast because it compiles source code to native code Actually, that's why it's slow. pypy is significantly slower than cpython in fact, primarily for sh
by shadowmint 13y ago
> It’s fast because it compiles source code to native code
Actually, that's why it's slow. pypy is significantly slower than cpython in fact, primarily for short-life scripts.
The initial start time can easily double or triple the run time in some cases.
To be fair, it's only a couple of seconds extra, but for many tiny scripts this amounts to a lot of wasted time. It's not a magical cure all in all situations.
...that said, its so fantastically easy to drop in, in most cases its worth trying to see how it performs just for fun~
pypy setup.py install
pypy app.py
[INFO ] Kivy v1.8.0-dev
[INFO ] [Logger ] Record log in /Users/d/.kivy/logs/kivy_14-01-15_2.txt
[INFO ] [Factory ] 156 symbols loaded
...
(drop in replacement for fun times? without having to change all your print and import statements? yes please~)
- squigs25 13y agoIt's slow to start, but fast to run (usually). Just want to make sure everyone understands that. So for a continuously running flask app, I think you could make a good case for it.
- usefulcat 13y agoSooo... the next logical step would be to add to pypy the ability to produce a natively executable file? Or has that already been done? (Disclaimer: I know relatively little about the python ecosystem).
- maxerickson 13y agoIt hasn't been done. If I understand correctly, it would be more like 'rewrite pypy to' rather than 'add to pypy'. Pypy does have tooling to convert a limited subset of python ( they call it RPython) into an exe.
- sitkack 13y agoIt isn't that limited. Also take a look at shedskin. http://en.wikipedia.org/wiki/Shed_Skin http://en.wikipedia.org/wiki/Shed_Skin