[pypy-dev] PGO Optimized PyPy Built

Patrascu, Alecsandru alecsandru.patrascu at intel.com
Tue Aug 2 02:16:49 EDT 2016


Hello Yash,

I've done experiments with LTO/PGO on PyPy, but because you have a JIT enabled, they are useless. Let me detail this a bit more.

LTO and PGO works on CPython and gives the performance you mentioned, because the code is not dynamic in nature, you only have a large codebase, with a lot of C code, some used, some duplicated, etc. Therefore any way the static code can be optimized at compile/link time, will bring benefits.

On the other hand, if you enable LTO/PGO on non-JIT version of PyPy, you get impressive results, with up to 15% compared with the baseline (PyPy no JIT), but no one uses PyPy that way. Without JIT, PyPy it's slower than CPython.

If you enable the JIT and use LTO/PGO you actually get no overall performance gain, but performance degrading, depending on the workload you are using. For example, on the Grand Unified Python Benchmark (GUPB), the number of benchmarks that have a speedup and slowdown are about even, in the range +/-3%, as measured on our Haswell systems. These results are not unexpected or weird, since doing PGO/LTO on other projects, such as Node.JS or HHVM, which also feature a JIT, got to the same outcome.

Regards,
Alecsandru

From: pypy-dev [mailto:pypy-dev-bounces+alecsandru.patrascu=intel.com at python.org] On Behalf Of Singh, Yashwardhan
Sent: Tuesday, August 2, 2016 2:31 AM
To: pypy-dev at python.org
Subject: [pypy-dev] PGO Optimized PyPy Built

Hi Everyone,

I was wondering if someone has tried to build pypy using PGO ( Profile Guided Optimization) and LTO (Link Time Optimization). CPython has an option of building the binary using PGO and LTO, which gives performance speedup upto 26% on some of the GUPB benchmarks, with average gain of 10% over the whole benchmark suite.
http://bugs.python.org/issue24915

Regards
Yash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20160802/6bf83747/attachment-0001.html>


More information about the pypy-dev mailing list