Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python3: enable optimizations.
@ 2023-05-07 16:51 mhmdanas
  2023-05-11 14:25 ` ahesford
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mhmdanas @ 2023-05-07 16:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2186 bytes --]

There is a new pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages python3-enable-optimizations-flag
https://github.com/void-linux/void-packages/pull/43791

python3: enable optimizations.
This `--enable-optimizations` flag enables profile-guided optimizations (PGO) and link-time optimization (LTO, but apparently only sometimes, depending on the platform). My rudimentary benchmarking indicates that compared to python3 from the repos, python3 built from this PR yielded performance improvements of around 10%-12% (I tried building python3 from master locally, but that one had horrendous performance for some reason). I'm not a benchmarking expert though, so I wanted others to try out their own benchmarks and post their results here.

On my potato laptop, this change tripled build time from 5 minutes to 15 minutes. I don't think this is an issue however because changes to the python3 template are not done often (averaging once per month in the last 12 months), and the builders are much beefier than my laptop, so their build times will be even shorter anyway.

TODO:
- [ ] Is this also needed for `python3-tkinter` (I don't think so, but better check)

#### Testing the changes
- I tested the changes in this PR: **YES** (only python3, not python3-tkinter)

@ahesford

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43791.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python3-enable-optimizations-flag-43791.patch --]
[-- Type: text/x-diff, Size: 1834 bytes --]

From a17071235e403805efed992992adf9e0f6363724 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 7 May 2023 19:39:08 +0300
Subject: [PATCH 1/2] python3: enable optimizations.

---
 srcpkgs/python3/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3/template b/srcpkgs/python3/template
index aebf41852764..3cac7ce90aa1 100644
--- a/srcpkgs/python3/template
+++ b/srcpkgs/python3/template
@@ -4,9 +4,9 @@
 #
 pkgname=python3
 version=3.11.3
-revision=1
-build_style="gnu-configure"
-configure_args="--enable-shared --enable-ipv6
+revision=2
+build_style=gnu-configure
+configure_args="--enable-shared --enable-ipv6 --enable-optimizations
  --enable-loadable-sqlite-extensions --with-computed-gotos
  --with-dbmliborder=gdbm:ndbm --with-system-expat --with-system-ffi
  --without-ensurepip ac_cv_working_tzset=yes"

From ee7cb61bf54b602ea98e7361267becb1651f3eb6 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 7 May 2023 19:40:32 +0300
Subject: [PATCH 2/2] python3-tkinter: enable optimizations.

---
 srcpkgs/python3-tkinter/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-tkinter/template b/srcpkgs/python3-tkinter/template
index ec080a818e69..2004df4c28f8 100644
--- a/srcpkgs/python3-tkinter/template
+++ b/srcpkgs/python3-tkinter/template
@@ -9,9 +9,9 @@ _desc="Python programming language"
 
 pkgname=python3-tkinter
 version=3.11.3
-revision=1
-build_style="gnu-configure"
-configure_args="--enable-shared --enable-ipv6
+revision=2
+build_style=gnu-configure
+configure_args="--enable-shared --enable-ipv6 --enable-optimizations
  --enable-loadable-sqlite-extensions --with-computed-gotos
  --with-dbmliborder=gdbm:ndbm --with-system-expat --with-system-ffi
  --without-ensurepip"

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-14 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-07 16:51 [PR PATCH] python3: enable optimizations mhmdanas
2023-05-11 14:25 ` ahesford
2023-05-12 12:10 ` tornaria
2023-08-08 18:40 ` [PR PATCH] [Updated] " mhmdanas
2023-08-13 13:10 ` ahesford
2023-08-13 13:11 ` [PR PATCH] [Closed]: " ahesford
2023-08-14 12:55 ` tornaria
2023-08-14 12:56 ` tornaria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).