From: "Ludovic Courtès" <ludo@gnu.org>
To: Julien Lepiller <julien@lepiller.eu>
Cc: 47251@debbugs.gnu.org
Subject: [bug#47251] [core-updates] [patch] gnu: python: Enable optimizations.
Date: Sun, 06 Jun 2021 14:34:31 +0200 [thread overview]
Message-ID: <87h7ibkw88.fsf@gnu.org> (raw)
In-Reply-To: <20210605174308.57c4a324@tachikoma.lepiller.eu> (Julien Lepiller's message of "Sat, 5 Jun 2021 17:43:08 +0200")
Hi,
Julien Lepiller <julien@lepiller.eu> skribis:
> Right, this is a good idea. I wrote the attached patches to: enable
> optimizations, prevent building and installing the static library and
> to install idle to a separate output, as it is not required in general.
>
> With the patch from https://issues.guix.gnu.org/47214, python 3.9 on
> coreupdates is ~1.7x faster than python 3.8 on master, and is ~25MB
> smaller than 3.8 on master (I haven't measured the speedup for python2,
> and it is ~10MB smaller with these changes than on master).
Yay!
> From 0c45d6e82a5f4d140840aef6b0de321122b6c4df Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Thu, 18 Mar 2021 23:41:40 +0100
> Subject: [PATCH 2/4] 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.
[...]
> + "CFLAGS=-fno-semantic-interposition"
> (string-append "LDFLAGS=-Wl,-rpath="
> - (assoc-ref %outputs "out") "/lib"))
> + (assoc-ref %outputs "out") "/lib"
> + " -fno-semantic-interposition"))
Could you add a comment for ‘-fno-semantic-interposition’? Also, please
make sure that setting CFLAGS does not override useful defaults (for
Autoconf-based build systems, CFLAGS defaults to ‘-O2 -g’ and overriding
it means you lost both -O2 and -g; if we lose ‘-g’, ‘--with-debug-info’
won’t have any effect).
> From 1faeb01becd558f0f4eec16ff32df9dbf1adda7f Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Thu, 3 Jun 2021 22:10:09 +0200
> Subject: [PATCH 3/4] gnu: python: Do not install static libraries.
>
> This is something Fedora already does since 2010, so it should be safe,
> and saves a lot of space.
>
> * gnu/packages/patches/python-2.7-no-static-lib.patch: New file.
> * gnu/packages/patches/python-3-no-static-lib.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add them.
> * gnu/packages/python.scm (python-2.7, python-3): Use them.
LGTM.
> From c650ac48be47b373c6c8c0b3495f30d9fe21e68b Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Thu, 3 Jun 2021 22:14:14 +0200
> Subject: [PATCH 4/4] gnu: python: Move idle to a separate output.
>
> idle is a programming environment that is not useful for building
> packages, but it is still useful for end users. This saves 5MB in the
> default output.
>
> * gnu/packages/python.scm (python-2.7)[outputs]: Add `idle'.
> [arguments]: Move idle files in the new output.
> (wrap-python): Do not wrap idle since it is in a different output.
Good idea, LGTM.
Thank you!
Ludo’.
next prev parent reply other threads:[~2021-06-06 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 23:16 [bug#47251] [core-updates] [patch] gnu: python: Enable optimizations Julien Lepiller
2021-03-31 12:47 ` Ludovic Courtès
2021-04-10 20:55 ` Ludovic Courtès
2021-04-10 20:55 ` Ludovic Courtès
2021-06-03 2:06 ` Julien Lepiller
2021-06-03 9:48 ` Ludovic Courtès
2021-06-05 15:43 ` Julien Lepiller
2021-06-06 12:34 ` Ludovic Courtès [this message]
2021-06-11 1:03 ` bug#47251: " Julien Lepiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7ibkw88.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=47251@debbugs.gnu.org \
--cc=julien@lepiller.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.