From c72e34aa0eb0db589557e047c5db0128273d5d12 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 18 Mar 2021 23:41:40 +0100 Subject: [PATCH 2/2] gnu: python: Enable optimizations. As a result, python execution time of scripts is decreased by 6 to 40%. gnu/packages/python (python-2.7)[arguments]: Add configure and make flags to optimize the resulting python. --- gnu/packages/python.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index da9859b11a..8de0ca343c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -183,7 +183,10 @@ "--with-system-expat" ;for XML support "--with-system-ffi" ;build ctypes "--with-ensurepip=install" ;install pip and setuptools + "--with-computed-gotos" ;main interpreter loop optimization + "--with-lto" ;increase size by 20MB, but 15% speedup "--enable-unicode=ucs4" + "--enable-optimizations" ;; Prevent the installed _sysconfigdata.py from retaining a reference ;; to coreutils. @@ -197,8 +200,10 @@ "ac_cv_file__dev_ptmx=no" "ac_cv_file__dev_ptc=no") '()) + "CFLAGS=-fno-semantic-interposition" (string-append "LDFLAGS=-Wl,-rpath=" - (assoc-ref %outputs "out") "/lib")) + (assoc-ref %outputs "out") "/lib" + " -fno-semantic-interposition")) ;; With no -j argument tests use all available cpus, so provide one. #:make-flags (list (string-append -- 2.30.0