GNU bug report logs - #47251
[core-updates] [patch] gnu: python: Enable optimizations.

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Thu, 18 Mar 2021 23:17:01 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Julien Lepiller <julien <at> lepiller.eu>
Subject: bug#47251: closed (Re: bug#47251: [core-updates] [patch] gnu:
 python: Enable optimizations.)
Date: Fri, 11 Jun 2021 01:04:01 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#47251: [core-updates] [patch] gnu: python: Enable optimizations.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 47251 <at> debbugs.gnu.org.

-- 
47251: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47251
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47251-done <at> debbugs.gnu.org
Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable
 optimizations.
Date: Fri, 11 Jun 2021 03:03:33 +0200
Le Sun, 06 Jun 2021 14:34:31 +0200,
Ludovic Courtès <ludo <at> gnu.org> a écrit :

> 
> > +             "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).
> 

With the patch, python still builds with -g -O3.

Pushed as 99d450b085b7bf44d669093f6c9964391ce1b451 to
e4aa346d57f61956626032d0d1dfca6b3c96e06a to core-updates, thanks!

[Message part 3 (message/rfc822, inline)]
From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [core-updates] [patch] gnu: python: Enable optimizations.
Date: Fri, 19 Mar 2021 00:16:22 +0100
[Message part 4 (text/plain, inline)]
Hi Guix!

This is the second patch I created in my exploration of our Python
package. Here, I noticed that our Python was very slow compared to
other distros and I tried to find which options they used. I found some
hints from Fedora. In this patch, I enable a few options and add a C/LD
flag to make python run faster.

I also attached a report of timing running the benchmark from
pyperformance on my Fedora machine. For comparison, I have also added
the results for Fedora's python3, which is somewhere in between.

I noticed that this increases the size of the python package by 20MB,
which is due entirely to --with-lto option, which also accounts for
half of the speedup. Overall, this python is almost twice as fast on
some benchmarks, and always faster on all of them. It's about 1.5 times
faster on average.

Strangely, the python package from Alpine is twice as small as this
package, and they use the --with-lto option. I wonder how they achieve
that.

Note that I modified python-2, as its flags are inherited by python-3
(and also the bootstrap python from commencement.scm).
[0002-gnu-python-Enable-optimizations.patch (text/x-patch, attachment)]
[python-report (application/octet-stream, attachment)]

This bug report was last modified 4 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.