[oe-commits] [openembedded-core] 08/12: python3: use regrtest instead of PyBench for profile-guided-optimisation

git at git.openembedded.org git at git.openembedded.org
Thu Sep 6 14:26:25 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e4f709f9f178d382acabbf1171d7df55db0ca7f7
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Thu Sep 6 12:15:21 2018 +0100

    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).
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/python/python3_3.5.5.bb | 12 +++++++-----
 1 file 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 b89e3b0..386b46a 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"
 EXTRA_OEMAKE += "CROSS_COMPILE=yes"
 EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip"
 
-PYTHON3_PROFILE_TASK ?= "${S}/Tools/pybench/pybench.py -n 1"
+PYTHON3_PROFILE_TASK ?= "./python -m test.regrtest --pgo test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_support || true"
 
 export CROSS_COMPILE = "${TARGET_PREFIX}"
 export _PYTHON_PROJECT_BASE = "${B}"
@@ -144,13 +144,15 @@ do_compile() {
 	if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then
 		run_make profile-opt
 		qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}"
-		cat > pgo-image-qemuwrapper << EOF
+		cat >pgo-wrapper <<EOF
 #!/bin/sh
-set -x
+cd ${B}
 $qemu_binary "\$@"
 EOF
-		chmod +x pgo-image-qemuwrapper
-		./pgo-image-qemuwrapper ${B}/python ${PYTHON3_PROFILE_TASK} || true
+		chmod +x pgo-wrapper
+		bbnote Gathering profiling data
+		./pgo-wrapper ${PYTHON3_PROFILE_TASK}
+		bbnote Profiling data gathered, rebuilding
 		run_make clean_and_use_profile
 	else
 		run_make libpython3.so

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list