nixpkgs-suyu/pkgs/development/interpreters
Greg Price f8a8243bd3 cpython: Use --enable-optimizations, for a 16% speedup.
Without this flag, the configure script prints a warning at the end,
like this (reformatted):

  If you want a release build with all stable optimizations active
  (PGO, etc), please run ./configure --enable-optimizations

We're doing a build to distribute to people for day-to-day use,
doing things other than developing the Python interpreter.  So
that's certainly a release build -- we're the target audience for
this recommendation.

---

And, trying it out, upstream isn't kidding!  I ran the standard
benchmark suite that the CPython developers use for performance
work, "pyperformance".  Following its usage instructions:
  https://pyperformance.readthedocs.io/usage.html
I ran the whole suite, like so:

  $ nix-shell -p ./result."$variant" --run '
      cd $(mktemp -d); python -m venv venv; . venv/bin/activate
      pip install pyperformance
      pyperformance run -o ~/tmp/result.'"$variant"'.json
    '

and then examined the results with commands like:

  $ python -m pyperf compare_to --table -G \
      ~/tmp/result.{$before,$after}.json

Across all the benchmarks in the suite, the median speedup was 16%.
(Meaning 1.16x faster; 14% less time).

The middle half of them ranged from a 13% to a 22% speedup.

Each of the 60 benchmarks in the suite got faster, by speedups
ranging from 3% to 53%.

---

One reason this isn't just the default to begin with is that, until
recently, it made the build a lot slower.  What it does is turn on
profile-guided optimization, which means first build for profiling,
then run some task to get a profile, then build again using the
profile.  And, short of further customization, the task it would use
would be nearly the full test suite, which includes a lot of
expensive and slow tests, and can easily take half an hour to run.

Happily, in 2019 an upstream developer did the work to carefully
select a more appropriate set of tests to use for the profile:
  https://github.com/python/cpython/commit/4e16a4a31
  https://bugs.python.org/issue36044
This suite takes just 2 minutes to run.  And the resulting final
build is actually slightly faster than with the much longer suite,
at least as measured by those standard "pyperformance" benchmarks.
That work went into the 3.8 release, but the same list works great
if used on older releases too.

So, start passing that --enable-optimizations flag; and backport
that good-for-PGO set of tests, so that we use it on all releases.
2020-05-11 23:37:04 -07:00
..
acl2
angelscript angelscript: 2.33.0 -> 2.34.0 2019-10-06 17:46:34 -07:00
bats
ceptre
chibi
clips
clisp
clojure clojure 1.10.1.492 -> 1.10.1.507 plus bugfix (#79868) 2020-02-12 11:50:50 +00:00
clojurescript/lumo cleanup 2020-02-19 23:40:14 +01:00
dart dart: 2.0.0 -> 2.7.1 (stable) + 2.0.0 -> 2.8.0-dev.10.0 (dev) 2020-02-27 14:23:27 +01:00
dhall Add Nixpkgs support for Dhall 2020-02-11 22:02:53 -08:00
duktape duktape: 2.4.0 -> 2.5.0 2019-12-08 21:47:09 +01:00
eff Treewide: fix more URL permanent redirects 2019-11-21 15:37:34 -08:00
elixir elixir_1_10: 1.10.1 -> 1.10.2 2020-02-26 13:12:21 +01:00
erlang erlangR22: 22.1.7 -> 22.3 2020-03-17 06:54:06 +01:00
evcxr evcxr: upgrade cargo fetcher and cargoSha256 2020-02-15 22:09:05 -08:00
falcon
gauche gauche: 0.9.8 -> 0.9.9 2019-12-16 20:20:20 -05:00
gnu-apl treewide: NIX_*_FLAGS -> string 2019-12-31 00:15:46 +01:00
groovy groovy: 2.5.9 -> 3.0.0 2020-02-12 12:34:24 +00:00
gtk-server gtk-server: 2.3.1 -> 2.4.5 2019-12-15 13:31:53 -08:00
guile guile: 2.2.6 -> 2.2.7 2020-03-11 23:56:38 +00:00
hugs
hy hy: use python2, build fails with 3 2019-11-13 16:27:38 +01:00
icon-lang icon-lang: fix build 2020-02-23 17:22:13 +01:00
io treewide: Get rid of libGLU_combined 2019-11-18 20:10:43 +00:00
j
janet janet: 1.6.0 -> 1.7.0 2020-02-07 10:54:34 +00:00
jimtcl treewide: NIX_*_FLAGS -> string 2019-12-31 00:15:46 +01:00
joker Revert "Merge pull request #83099 from marsam/fix-buildGoModule-packages-darwin" 2020-03-27 07:33:21 +00:00
jruby jruby: 9.2.10.0 -> 9.2.11.0 2020-03-05 02:42:20 +00:00
jython jython: 2.7.2b2 -> 2.7.2b3 2020-02-23 13:41:27 -08:00
kona treewide: replace make/build/configure/patchFlags with nix lists 2019-12-30 12:58:11 +01:00
lfe lfe: 1.2.1 -> 1.3 2020-02-10 20:03:47 +01:00
lolcode
love treewide: NIX_*_FLAGS -> string 2019-12-31 00:15:46 +01:00
lua-5 buidLuarocksPackage: add a checkPhase 2020-02-26 01:14:30 +01:00
luajit luajit: Expose build options, enable JIT debug module 2020-02-15 18:40:02 +01:00
lush treewide: Get rid of libGLU_combined 2019-11-18 20:10:43 +00:00
maude maude: update from version 2.7.1 to 3.0 (including full-maude) 2020-01-31 16:25:40 +01:00
metamath metamath: 0.180 -> 0.181 2020-03-14 03:24:44 +00:00
micropython micropython: init at 1.12 2020-01-03 10:57:55 +01:00
mujs
nix-exec
octave Build octave on macos 2020-03-23 06:31:11 +00:00
perl perl: Enable threading on darwin 2020-02-20 08:35:45 +01:00
php php: get rid of with lib; used on entire file 2020-03-15 18:04:57 +01:00
picoc
picolisp picolisp: 19.6 -> 19.12 2020-01-06 22:25:42 -08:00
pixie
proglodyte-wasm treewide: mark some broken packages as broken 2019-10-08 17:14:26 +02:00
pure pure: mark as broken 2020-01-30 18:35:30 -05:00
pyrex
python cpython: Use --enable-optimizations, for a 16% speedup. 2020-05-11 23:37:04 -07:00
qnial
quickjs treewide: Remove myself from maintainers on some packages (#78027) 2020-01-19 12:18:34 -05:00
racket racket: enable building on aarch64 2020-03-16 15:23:31 +01:00
rakudo rakudo: 2020.02 -> 2020.02.1 2020-03-27 02:00:17 -07:00
rascal
rebol
red
regina
renpy treewide: Get rid of libGLU_combined 2019-11-18 20:10:43 +00:00
ruby ruby_2_4: remove 2020-02-10 13:23:35 -05:00
scheme48
scsh
self
spidermonkey treewide: replace make/build/configure/patchFlags with nix lists 2019-12-30 12:58:11 +01:00
supercollider supercollider: 3.10.3 -> 3.10.4 2020-01-30 11:03:45 +00:00
tcl tcl: fix dangling symlink 2019-12-19 09:46:36 -05:00
tinyscheme
unicon-lang
wasmer wasmer: 0.13.0 -> 0.16.2 2020-03-12 19:06:47 +01:00
wasmtime wasmtime: bump to v0.12.0 (from v0.8.0) 2020-03-01 02:34:43 +01:00