Python: Difference between revisions
→Performance: LTO is enabled on Linux x64 and only resulting wheels are not reproducible
Widlarizer (talk | contribs) (Order matters in the case of multiple python3.withPackages) |
(→Performance: LTO is enabled on Linux x64 and only resulting wheels are not reproducible) |
||
Line 313: | Line 313: | ||
== Performance == | == Performance == | ||
The derivation of | The derivation of CPython that is available via <code>nixpkgs</code> only contains optimizations that do not harm reproducibility. Link-Time-Optimization (LTO) is only enabled on 64-bit Linux systems, while Profile Guided Optimization (PGO) is currently disabled. See [https://docs.python.org/3/using/configure.html#performance-options Configuring Python 3.1.3. Performance options] | ||
Additionally, when you compile something within <code>nix-shell</code> or a derivation; by default there are security hardening flags passed to the compiler which do have a small performance impact. | Additionally, when you compile something within <code>nix-shell</code> or a derivation; by default there are security hardening flags passed to the compiler which do have a small performance impact. | ||
As of the time of this writing; these optimizations cause Python | As of the time of this writing; these optimizations cause Python wheels to be non-reproducible and increase install times for the derivation. For a more detailed overview of the trials and tabulations of discovering the performance regression; see [https://discourse.nixos.org/t/why-is-the-nix-compiled-python-slower/18717 Why is the nix-compiled Python slower?] thread on the nix forums. | ||