<br><br><div class="gmail_quote">On 7 October 2011 17:50, Maciej Fijalkowski <span dir="ltr">&lt;<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Fri, Oct 7, 2011 at 1:33 PM, Igor Katson &lt;<a href="mailto:igor.katson@gmail.com">igor.katson@gmail.com</a>&gt; wrote:<br>
&gt; When I first started benchmarking one of my Django sites,<br>
&gt; <a href="http://trip-travel.ru/" target="_blank">http://trip-travel.ru/</a> (using postgres driver pypq),<br>
&gt; I was disappointed by the results. PyPy was visually much slower than<br>
&gt; cPython (I just looked at how the site loads in the browser)<br>
&gt;<br>
&gt; But today I got some incredible results, I finally made PyPy to work faster<br>
&gt; than cPython, and found out that it got faster after loading the page<br>
&gt; several hundred times with &quot;ab&quot; or &quot;siege&quot;<br>
&gt;<br>
&gt; Here a the results, of mean response time by querying the home page with<br>
&gt; apache&#39;s &quot;ab&quot; (cPython 2.7.2, Django 1.3, PyPy 1.6.0), served with cherrypy<br>
&gt; wsgi server:<br>
&gt;<br>
&gt; After 10 requests (excluding the first request):<br>
&gt; cPython - 163.529 ms<br>
&gt; PyPy - 460.879 ms<br>
&gt;<br>
&gt; 50 request more:<br>
&gt; cPython - 168.539<br>
&gt; PyPy - 249.850<br>
&gt;<br>
&gt; 100 requests more:<br>
&gt; cPython - 166.278 ms<br>
&gt; PyPy - 131.104<br>
&gt;<br>
&gt; 100 requests more:<br>
&gt; cPython - 165.820<br>
&gt; PyPy - 115.446<br>
&gt;<br>
&gt; 300 requests more:<br>
&gt; cPython - 165.543<br>
&gt; PyPy - 107.636<br>
&gt;<br>
&gt; 300 requests more:<br>
&gt; cPython - 166.425<br>
&gt; PyPy - 103.065<br>
<br>
</div></div>Thanks for doing the benchmarks :)<br>
<div class="im"><br>
&gt;<br>
&gt; As we can see, the JIT needs much time to warm up, but when it does, the<br>
&gt; result is pretty noticeable.<br>
&gt; By the way, with psycopg2, the site responds for 155.766 ms in average (only<br>
&gt; 10 ms faster), so using PyPy with Django makes much sense for me.<br>
&gt;<br>
&gt; As for now, pypy cannot run with uWSGI, which I use in production, but maybe<br>
&gt; i&#39;ll switch to PyPy for production deployments if &quot;PyPy + PyPQ + Some pure<br>
&gt; python WSGI server&quot; suite will outperform (uWSGI + cPython + psycopg2).<br>
&gt; Though, the need to load the page 500 times after each server reload is not<br>
&gt; comfortable.<br>
<br>
</div>I&#39;ve heard people using gunicorn. Maybe this is a good try? Loading<br>
the pages is indeed annoying, but you need to load it a couple times<br>
for results not to be noticably slower :) We kind of know that the JIT<br>
warmup time is high, but it&#39;s partly a thing to fix and partly an<br>
inherent property of the JIT.<br>
<br></blockquote><div><br><br>FWIW I shared this internally at Canonical, and whilst people were impressed there was some concern that having substantially worse performance for the first few hundred requests would a) be a showstopper and b) screw up metrics. The technique of deliberate warming immediately after restart is interesting, but it would be hard to hit all the code paths.<br>
<br>I realise this is inherent in the way the jit works - but I thought it was a response worth sharing. I also assured them that pre-warm-up performance would continue to improve as pypy improves. ;-)<br><br>All the best,<br>
<br>Michael Foord <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Cheers,<br>
fijal<br>
_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">http://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br><br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>
May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>
<br>