Bug 279585 - lang/python311: Improve build times
Summary: lang/python311: Improve build times
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-08 06:24 UTC by Daniel Engberg
Modified: 2024-06-23 18:42 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments
Patch for python311 (1000 bytes, patch)
2024-06-08 06:24 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2024-06-08 06:24:42 UTC
Created attachment 251284 [details]
Patch for python311

- Don't build with debug symbols by default, we discard these anyway and it reduces build time with roughly 1/4th (real) on my Tigerlake laptop with LTO enabled. If debug symbols are needed use our framework's WITH_DEBUG switch

Tested on 14.0-RELEASE (amd64)

With debug symbols (default)
        4m29.16s real           6m38.66s user           17.27s sys

Without debug symbols (-g)
        3m13.45s real           5m9.13s user            16.24s sys

- Switch from -flto=thin to lto, there's no parallization so it's actually slower and produces larger binaries

With -flto=thin (default)
        3m13.45s real           5m9.13s user            16.24s sys
-rw-r--r--   1 root wheel 6332792 Jun  8 07:29 libpython3.11.so.1.0

With -flto
        2m42.62s real           4m48.13s user           16.68s sys
-rw-r--r--   1 root wheel 6224104 Jun  8 07:51 libpython3.11.so.1.0
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2024-06-08 17:00:03 UTC
On my aarch64 VM, 4 cores

With debug symbols and -flto=thin (default)
====> Compressing man pages (compress-man)
        6m37.64s real           7m18.00s user           52.50s sys

With patched applied
====> Compressing man pages (compress-man)
        4m7.93s real            4m42.84s user           52.27s sys
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2024-06-12 16:33:52 UTC
Friendly ping
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2024-06-21 08:40:51 UTC
Friendly ping one last time
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-06-23 18:39:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a7cf5f2a3a2c8adb21d4cdb5a8ed6dd48a636b5d

commit a7cf5f2a3a2c8adb21d4cdb5a8ed6dd48a636b5d
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-06-23 17:48:15 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2024-06-23 18:19:18 +0000

    lang/python311: Improve build times

    Don't generate debug symbols by default, we discard these anyway and on my
    Tigerlake laptop it reduces build time roughly by 25% with LTO enabled
    Switch from -flto=thin to (fat)lto, there's no parallization so it's
    actually slower and produces slightly larger binaries

    PR:             279585
    Approved by:    portmgr (maintainer timeout, 2+ weeks)

 lang/python311/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)