Pros: we are seeing a 10% performance boost for all python processes. Cons: The time to build python increases. This is because pgo (profile guided optimizations) need the unit tests for python to be invoked and then the entire package compiled a second time using the timing information from the unit test profiling data that is gathered. This commit sets up the src rpm environment for building python 2.7.5 - Needed to disable the tox unit test check phase since a couple tests fail due to build dependencies - Turn off dtrace and systemtap in the spec file - Use pgo for build in modules: https://bugs.python.org/issue26307 - Rollup cpython patches and add --enable-optimizations and --with-computed-gotos for optimized build These are the cpython commits pulled in: 4ff151a72a3331c514924a5e0d33747a91413fbd (Sept 18, 2015 pgo) c543a0fc3b2052c35fced09e1f96613625723508 (Jun 2 2016) (lto) 6d8fdfc84b8617476f3f497e93e9e7b6cecc5474 (Sept 8 2016) 794b2912acc1995afc6fe9501cc0ca8e56565325 (Sept 8 2016) b9999158545f3bc089b926086daa666b8e4c7caa (Nov 20) 2016 6a04ef7ceddae0930eba6cc57ba2ebfcef00abab Mar 28 2017 This still does not yield the same level of performance as a vanilla python 2.7.14 source tree which suggests there are other commits that would provide a performance boost. Change-Id: Iaddf7ead672412ad1878217ddcfaf88c9b0e2443 Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
43 lines
1.1 KiB
Diff
43 lines
1.1 KiB
Diff
From ff1efc0b077c78bedead5fdc6792240806f5a97c Mon Sep 17 00:00:00 2001
|
|
From: Al Bailey <Al.Bailey@windriver.com>
|
|
Date: Wed, 28 Mar 2018 08:26:56 -0500
|
|
Subject: [PATCH] Make Python Faster
|
|
|
|
---
|
|
SPECS/python.spec | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/SPECS/python.spec b/SPECS/python.spec
|
|
index adc6815..fadf838 100644
|
|
--- a/SPECS/python.spec
|
|
+++ b/SPECS/python.spec
|
|
@@ -1195,6 +1195,8 @@ Patch268: 00268-set-stream-name-to-None.patch
|
|
# above:
|
|
Patch5000: 05000-autotool-intermediates.patch
|
|
|
|
+Patch9000: Rollup-optimization-commits.patch
|
|
+
|
|
# ======================================================
|
|
# Additional metadata, and subpackages
|
|
# ======================================================
|
|
@@ -1591,6 +1593,7 @@ find -name "*~" |xargs rm -f
|
|
%patch5000 -p0 -b .autotool-intermediates
|
|
%endif
|
|
|
|
+%patch9000 -p1
|
|
|
|
# ======================================================
|
|
# Configuring and building the code:
|
|
@@ -1721,7 +1724,7 @@ BuildPython debug \
|
|
BuildPython optimized \
|
|
python \
|
|
python%{pybasever} \
|
|
- "" \
|
|
+ "--enable-optimizations --with-computed-gotos" \
|
|
true
|
|
|
|
|
|
--
|
|
1.8.3.1
|
|
|