diff -r da483bda6efc README --- a/README Mon Aug 24 16:17:13 2015 -0400 +++ b/README Mon Sep 07 13:09:47 2015 +0300 @@ -173,6 +173,11 @@ build your desired target. The interpreter executable is built in the top level directory. +If you need an optimized version of Python, you type "make profile-opt" +in the top level directory. This will rebuild the interpreter executable +using Profile Guided Optimization (PGO). For more details, see the +section bellow. + Once you have built a Python interpreter, see the subsections below on testing and installation. If you run into trouble, see the next section. @@ -185,6 +190,31 @@ interpreter has been built. +Profile Guided Optimization +--------------------------- + +PGO takes advantage of recent versions of compilers, both GCC and Clang. +If ran, the "profile-opt" rule will do several steps. + +First, the entire Python directory is cleaned for temporary files that +may resulted in a previous compilation. + +Then, an instrumented version of the interpreter is built, using suitable +compiler flags for each flavour. Note that this is just an intermediary +step and the binary resulted after this step is not good for real life +workloads, as it has profiling instructions embedded inside. + +After this instrumented version of the interpreter is built, the Makefile +will automatically run a training workload. This is necessary in order to +profile the interpreter execution. Note also that any output, both stdout +and stderr, that may appear at this step is supressed and errors will not +adversely affect the results. + +Finaly, the last step is to rebuild the interpreter, using the information +collected in the previous one. The end result will be a the Python binary +that is optimized and suitable for distribution or production installation. + + Troubleshooting ---------------