summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2015-09-18 15:09:42 -0700
committerBrett Cannon <brett@python.org>2015-09-18 15:09:42 -0700
commit4ff151a72a3331c514924a5e0d33747a91413fbd (patch)
tree6a911a48917de5a71557cb5a187281f6e232a1b5 /README
parent62f0ffa86136f06c84cee139f29aa3b9ad0385a3 (diff)
downloadcpython-git-4ff151a72a3331c514924a5e0d33747a91413fbd.tar.gz
Issue #24915: Make PGO builds support Clang and use the test suite for
profile data. Thanks to Alecsandru Patrascu of Intel for the initial patch.
Diffstat (limited to 'README')
-rw-r--r--README29
1 files changed, 29 insertions, 0 deletions
diff --git a/README b/README
index 252d90ea5c..85c47bbc14 100644
--- a/README
+++ b/README
@@ -173,6 +173,11 @@ rebuilt. In this case, you may have to run make again to correctly
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 below.
+
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,30 @@ guidance of the setup.py script, which is run by Make after the
interpreter has been built.
+Profile Guided Optimization
+---------------------------
+
+PGO takes advantage of recent versions of the GCC or Clang compilers.
+If ran, the "profile-opt" rule will do several steps.
+
+First, the entire Python directory is cleaned of 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.
+
+Finally, 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
---------------