<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Alright, trying 10,000 warmup requests, and then 100 benchmark
    requests, "production" scenario (gunicorn, one worker, no debug):<br>
    <br>
    <tt>PyPy3          26.956 [ms]</tt><tt><br>
    </tt><tt>CPython 3.4    10.822 [ms]</tt><br>
    <br>
    So, not much improvement there. Also consider the slight
    inconvenience of mandatory manual warmup every deploy:<br>
    <br>
    * would I need to warm up just the site, every application, or every
    template?<br>
    * I'd need a prepared session to warm up anything except the login
    page<br>
    * I'll be running more worker processes, so even more warmup
    requests, hopefully they'd get distributed evenly amongst the
    workers<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 07.02.2015 07:56, Omer Katz wrote:<br>
    </div>
    <blockquote
cite="mid:CAOZCFcCb8_i5u-869QEFtOyKUWL1uQvxu3vjwJc5Yr6=v+1h9Q@mail.gmail.com"
      type="cite">
      <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 moz-do-not-send="true"
                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 moz-do-not-send="true"
              href="https://github.com/Tinche/PyPy-Django-Playground"
              target="_blank">https://github.com/Tinche/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>
            _______________________________________________<br>
            pypy-dev mailing list<br>
            <a moz-do-not-send="true" href="mailto:pypy-dev@python.org"
              target="_blank">pypy-dev@python.org</a><br>
            <a moz-do-not-send="true"
              href="https://mail.python.org/mailman/listinfo/pypy-dev"
              target="_blank">https://mail.python.org/mailman/listinfo/pypy-dev</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>