diff options
author | Ross Burton <ross.burton@intel.com> | 2018-09-06 12:15:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-10 12:13:06 +0100 |
commit | d9f7b9d3ad44195e68b2c1b09e3eb42e623c9a20 (patch) | |
tree | 7d9c4991c1d0ab372f3ee60a7a907f6c0272420f /meta/recipes-devtools/python | |
parent | dbb2d923de2ab76e7b93dea1f0a5d6119b1df6a8 (diff) | |
download | poky-d9f7b9d3ad44195e68b2c1b09e3eb42e623c9a20.tar.gz |
python3: use regrtest instead of PyBench for profile-guided-optimisation
PyBench takes a long time to run, also upstream have removed it from Python and
instead use test.regrtest —pgo to profile the interpreter.
The results are good: not only does Python compile faster (~300s vs ~600s on my
machine) but Phoronix’s PyBench test runs in 2130ms compared to 2229ms when
using PyBench to train (and 2345ms with PGO disabled).
(From OE-Core rev: 98b2b6c3eae15d9b84c97c6a1495040f6b7e389a)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r-- | meta/recipes-devtools/python/python3_3.5.5.bb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb index cd60857926..40896dbc08 100644 --- a/meta/recipes-devtools/python/python3_3.5.5.bb +++ b/meta/recipes-devtools/python/python3_3.5.5.bb | |||
@@ -76,7 +76,7 @@ SDK_CC_ARCH += "-DNDEBUG -fno-inline" | |||
76 | EXTRA_OEMAKE += "CROSS_COMPILE=yes" | 76 | EXTRA_OEMAKE += "CROSS_COMPILE=yes" |
77 | EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip" | 77 | EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip" |
78 | 78 | ||
79 | PYTHON3_PROFILE_TASK ?= "${S}/Tools/pybench/pybench.py -n 1" | 79 | PYTHON3_PROFILE_TASK ?= "./python -m test.regrtest --pgo test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_support || true" |
80 | 80 | ||
81 | export CROSS_COMPILE = "${TARGET_PREFIX}" | 81 | export CROSS_COMPILE = "${TARGET_PREFIX}" |
82 | export _PYTHON_PROJECT_BASE = "${B}" | 82 | export _PYTHON_PROJECT_BASE = "${B}" |
@@ -144,13 +144,15 @@ do_compile() { | |||
144 | if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then | 144 | if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then |
145 | run_make profile-opt | 145 | run_make profile-opt |
146 | qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}" | 146 | qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}" |
147 | cat > pgo-image-qemuwrapper << EOF | 147 | cat >pgo-wrapper <<EOF |
148 | #!/bin/sh | 148 | #!/bin/sh |
149 | set -x | 149 | cd ${B} |
150 | $qemu_binary "\$@" | 150 | $qemu_binary "\$@" |
151 | EOF | 151 | EOF |
152 | chmod +x pgo-image-qemuwrapper | 152 | chmod +x pgo-wrapper |
153 | ./pgo-image-qemuwrapper ${B}/python ${PYTHON3_PROFILE_TASK} || true | 153 | bbnote Gathering profiling data |
154 | ./pgo-wrapper ${PYTHON3_PROFILE_TASK} | ||
155 | bbnote Profiling data gathered, rebuilding | ||
154 | run_make clean_and_use_profile | 156 | run_make clean_and_use_profile |
155 | else | 157 | else |
156 | run_make libpython3.so | 158 | run_make libpython3.so |