<div dir="rtl"><div dir="ltr">You need to warm up the JIT first.<br></div><div dir="ltr">Run the benchmark a 10,000 times on PyPy before measuring and you'll see the real performance improvement.<br></div><div dir="ltr">Nevertheless, it does sound like you're hitting a performance bug(s) somewhere. It's worth investigating.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-02-07 1:12 GMT+02:00 Tin Tvrtković <span dir="ltr"><<a href="mailto:tinchester@gmail.com" target="_blank">tinchester@gmail.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, PyPy folks!<br>
<br>
While trying to speed up one of my Django sites, I noticed a new version of PyPy<br>
had just been released. So I grabbed a fresh download of PyPy 3 (since this is<br>
a Python 3 codebase) and tried taking it out for a spin.<br>
<br>
However, as far as I can see, whatever I try PyPy is consistently slower than<br>
CPython for this.<br>
<br>
Since this is a proprietary site, I've basically ripped out all the code except<br>
my settings.py and my requirements; and am benchmarking the Django admin index.<br>
The results are about the same.<br>
<br>
I've set up a small repo that can be used to reproduce the environment:<br>
<a href="https://github.com/Tinche/PyPy-Django-Playground" target="_blank">https://github.com/Tinche/<u></u>PyPy-Django-Playground</a>. There's additional info in<br>
the README there.<br>
<br>
These tests have been carried out on Ubuntu Trusty, 64-bit. CPython 3 is the<br>
system Python, 3.4. PyPy has been downloaded from the official site and<br>
unzipped.<br>
<br>
So what I basically do is set up an admin session, and use the Django main admin<br>
page. 200 warmup requests, then 100 benchmarked requests, look at the mean<br>
request time.<br>
<br>
Some results:<br>
<br>
Django's runserver, DEBUG mode:<br>
<br>
PyPy3            485.389 [ms]<br>
CPython 3.4      105.777 [ms]<br>
<br>
Django's runserver, no debug:<br>
<br>
PyPy3             44.661 [ms]<br>
CPython 3.4       18.697 [ms]<br>
<br>
Gunicorn, 1 worker, no debug:<br>
<br>
PyPy3             28.615 [ms]<br>
CPython 3.4       13.532 [ms]<br>
<br>
I don't exactly claim to be an expert on benchmarking, but assuming my site<br>
is similar to the Django admin, CPython's gonna be giving me better performance.<br>
Also the debug runserver performance is kinda worrying. Nobody's going to be<br>
running this in production, but it makes development a little slower and more<br>
annoying than it should be.<br>
<br>
Is there anything to make PyPy more competitive in these kinds of scenarios?<br>
<br>
Kind regards,<br>
Tin<br>
______________________________<u></u>_________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org" target="_blank">pypy-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/pypy-dev</a><br>
</blockquote></div><br></div>