From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 18 19:16:49 2021 Received: (at submit) by debbugs.gnu.org; 18 Mar 2021 23:16:49 +0000 Received: from localhost ([127.0.0.1]:48311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lN1sn-0000Kb-BX for submit@debbugs.gnu.org; Thu, 18 Mar 2021 19:16:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:44286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lN1sl-0000KT-Ah for submit@debbugs.gnu.org; Thu, 18 Mar 2021 19:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lN1sk-0002Pf-AQ for guix-patches@gnu.org; Thu, 18 Mar 2021 19:16:47 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:34472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lN1sf-0002u7-TB for guix-patches@gnu.org; Thu, 18 Mar 2021 19:16:45 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 92d4e09d for ; Thu, 18 Mar 2021 23:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=vZN HBooyBAu/d1FOHpR/wW29LjCCdGxPYoArIV+X0QQ=; b=lf2L2fKw0LL5z3RBDsH TZj1PIXU9FMbuuVhiDZB5VlrAN0M7/SUGwTT1c/wtn255qtJ0YbJuL+6FqnZ9wYP Mp70sA4/bDZt7kp/WBu3nHWTdaOVWsSsBMOmX43xlGqUi4UR0noaIVfJS4X0CpWA gQ0JDBoMCZyXuC+85z+3mCq3ygKwZlIwJOqTE6k+1Fx1pNvmDYYAeqPxmSyizP2A bJpSu7GZr5RKaN4hTgdpYTOUbAYQwEp9FjpfXEDqp5l8JvNkK2a51lDUd+4QLlM2 wh84mN/lnR46vglLTbkbSBnToSIPzvDXLqdlP7t6s1ocXwgPe06MxZnJFSNDsYPT ifA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id de649271 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Thu, 18 Mar 2021 23:16:36 +0000 (UTC) Date: Fri, 19 Mar 2021 00:16:22 +0100 From: Julien Lepiller To: guix-patches@gnu.org Subject: [core-updates] [patch] gnu: python: Enable optimizations. Message-ID: <20210319001622.1c19ad41@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/tZs_.Vg4a.HgJHHS0Xe7k7L" Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --MP_/tZs_.Vg4a.HgJHHS0Xe7k7L Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: 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). --MP_/tZs_.Vg4a.HgJHHS0Xe7k7L Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-gnu-python-Enable-optimizations.patch >From c72e34aa0eb0db589557e047c5db0128273d5d12 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 18 Mar 2021 23:41:40 +0100 Subject: [PATCH 2/2] 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. --- gnu/packages/python.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index da9859b11a..8de0ca343c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -183,7 +183,10 @@ "--with-system-expat" ;for XML support "--with-system-ffi" ;build ctypes "--with-ensurepip=install" ;install pip and setuptools + "--with-computed-gotos" ;main interpreter loop optimization + "--with-lto" ;increase size by 20MB, but 15% speedup "--enable-unicode=ucs4" + "--enable-optimizations" ;; Prevent the installed _sysconfigdata.py from retaining a reference ;; to coreutils. @@ -197,8 +200,10 @@ "ac_cv_file__dev_ptmx=no" "ac_cv_file__dev_ptc=no") '()) + "CFLAGS=-fno-semantic-interposition" (string-append "LDFLAGS=-Wl,-rpath=" - (assoc-ref %outputs "out") "/lib")) + (assoc-ref %outputs "out") "/lib" + " -fno-semantic-interposition")) ;; With no -j argument tests use all available cpus, so provide one. #:make-flags (list (string-append -- 2.30.0 --MP_/tZs_.Vg4a.HgJHHS0Xe7k7L Content-Type: application/octet-stream; name=python-report Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=python-report ICAgICAgICAgICAgICAgICAgICAgICAgfCBvcHRpbWl6ZWQgYy11ICAgICAgICB8IGN1cnJlbnQg Yy11ICAgICAgICAgIHwgZmVkb3JhICgzLjguMikKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0t LS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0t LS0tLS0tCjJ0bzMgICAgICAgICAgICAgICAgICAgIHwgNTExIG1zICstIDI1IG1zICAgICAgfCA2 MTcgbXMgKy0gMjEgbXMgICAgICB8IDU3OCBtcyArLSAyMyBtcwpjaGFtZWxlb24gICAgICAgICAg ICAgICB8IDEzLjggbXMgKy0gMC4zIG1zICAgIHwgMTguMCBtcyArLSAwLjUgbXMgICAgfCAxNi4x IG1zICstIDAuNiBtcwpjaGFvcyAgICAgICAgICAgICAgICAgICB8IDE2MiBtcyArLSA0IG1zICAg ICAgIHwgMjMyIG1zICstIDMgbXMgICAgICAgfCAyMDQgbXMgKy0gNCBtcwpjcnlwdG9fcHlhZXMg ICAgICAgICAgICB8IDE2MiBtcyArLSAzIG1zICAgICAgIHwgMjA1IG1zICstIDUgbXMgICAgICAg fCAyMTggbXMgKy0gOCBtcwpkZWx0YWJsdWUgICAgICAgICAgICAgICB8IDEwLjggbXMgKy0gMC4z IG1zICAgIHwgMTUuMyBtcyArLSAwLjUgbXMgICAgfCAxMi44IG1zICstIDAuMyBtcwpkamFuZ29f dGVtcGxhdGUgICAgICAgICB8IDc1LjggbXMgKy0gMS4wIG1zICAgIHwgMTA0IG1zICstIDMgbXMg ICAgICAgfCA4OC4yIG1zICstIDEuOCBtcwpkdWx3aWNoX2xvZyAgICAgICAgICAgICB8IDExMSBt cyArLSA0IG1zICAgICAgIHwgMTMzIG1zICstIDIgbXMgICAgICAgfCAxMjEgbXMgKy0gNyBtcwpm YW5ua3VjaCAgICAgICAgICAgICAgICB8IDY5NSBtcyArLSA5IG1zICAgICAgIHwgODIyIG1zICst IDggbXMgICAgICAgfCA4NzQgbXMgKy0gMTYgbXMKZmxvYXQgICAgICAgICAgICAgICAgICAgfCAx NzEgbXMgKy0gOCBtcyAgICAgICB8IDIwOSBtcyArLSA0IG1zICAgICAgIHwgMjE3IG1zICstIDgg bXMKZ2Vuc2hpX3RleHQgICAgICAgICAgICAgfCA0My44IG1zICstIDAuOCBtcyAgICB8IDU1LjQg bXMgKy0gMC44IG1zICAgIHwgNTMuNSBtcyArLSAyLjYgbXMKZ2Vuc2hpX3htbCAgICAgICAgICAg ICAgfCA5My44IG1zICstIDEuNSBtcyAgICB8IDExMyBtcyArLSAxIG1zICAgICAgIHwgMTE1IG1z ICstIDYgbXMKZ28gICAgICAgICAgICAgICAgICAgICAgfCAzNzIgbXMgKy0gNyBtcyAgICAgICB8 IDQ5NyBtcyArLSA0IG1zICAgICAgIHwgNDUzIG1zICstIDggbXMKaGV4aW9tICAgICAgICAgICAg ICAgICAgfCAxNC40IG1zICstIDAuNSBtcyAgICB8IDE4LjkgbXMgKy0gMC4yIG1zICAgIHwgMTgu MiBtcyArLSAxLjAgbXMKanNvbl9kdW1wcyAgICAgICAgICAgICAgfCAxOS4yIG1zICstIDAuNSBt cyAgICB8IDIzLjAgbXMgKy0gMC4zIG1zICAgIHwgMjIuNyBtcyArLSAxLjAgbXMKanNvbl9sb2Fk cyAgICAgICAgICAgICAgfCAzNC45IHVzICstIDAuNyB1cyAgICB8IDQzLjUgdXMgKy0gMC43IHVz ICAgIHwgNDguMSB1cyArLSAyLjIgdXMKbG9nZ2luZ19mb3JtYXQgICAgICAgICAgfCAxNC42IHVz ICstIDAuOCB1cyAgICB8IDIwLjAgdXMgKy0gMC41IHVzICAgIHwgMTYuOSB1cyArLSAxLjAgdXMK bG9nZ2luZ19zaWxlbnQgICAgICAgICAgfCAyOTAgbnMgKy0gMTMgbnMgICAgICB8IDM5OSBucyAr LSAxMCBucyAgICAgIHwgMzQzIG5zICstIDEwIG5zCmxvZ2dpbmdfc2ltcGxlICAgICAgICAgIHwg MTMuMSB1cyArLSAwLjMgdXMgICAgfCAxOC40IHVzICstIDAuNyB1cyAgICB8IDE1LjUgdXMgKy0g MC42IHVzCm1ha28gICAgICAgICAgICAgICAgICAgIHwgMjQuMCBtcyArLSAwLjQgbXMgICAgfCAz MS4yIG1zICstIDAuNyBtcyAgICB8IDI5LjYgbXMgKy0gMS4yIG1zCm1ldGVvcl9jb250ZXN0ICAg ICAgICAgIHwgMTU3IG1zICstIDQgbXMgICAgICAgfCAxNzkgbXMgKy0gMiBtcyAgICAgICB8IDE4 OSBtcyArLSA5IG1zCm5ib2R5ICAgICAgICAgICAgICAgICAgIHwgMTg0IG1zICstIDQgbXMgICAg ICAgfCAyNTEgbXMgKy0gNCBtcyAgICAgICB8IDIyOSBtcyArLSA0IG1zCm5xdWVlbnMgICAgICAg ICAgICAgICAgIHwgMTQ1IG1zICstIDMgbXMgICAgICAgfCAxODAgbXMgKy0gNSBtcyAgICAgICB8 IDE4NCBtcyArLSA1IG1zCnBhdGhsaWIgICAgICAgICAgICAgICAgIHwgMjguNCBtcyArLSAwLjcg bXMgICAgfCAzNi4wIG1zICstIDEuMyBtcyAgICB8IDM1LjIgbXMgKy0gMi40IG1zCnBpY2tsZSAg ICAgICAgICAgICAgICAgIHwgMTQuNiB1cyArLSAwLjcgdXMgICAgfCAxNy4zIHVzICstIDAuNSB1 cyAgICB8IDE2LjQgdXMgKy0gMC42IHVzCnBpY2tsZV9kaWN0ICAgICAgICAgICAgIHwgMzUuMSB1 cyArLSAwLjQgdXMgICAgfCA0Mi4zIHVzICstIDAuNiB1cyAgICB8IDQyLjggdXMgKy0gMi4wIHVz CnBpY2tsZV9saXN0ICAgICAgICAgICAgIHwgNS40MiB1cyArLSAwLjE5IHVzICAgfCA2LjI0IHVz ICstIDAuMTAgdXMgICB8IDYuMzQgdXMgKy0gMC4zNSB1cwpwaWNrbGVfcHVyZV9weXRob24gICAg ICB8IDY5OSB1cyArLSAxNSB1cyAgICAgIHwgOTQxIHVzICstIDE5IHVzICAgICAgfCA4MDAgdXMg Ky0gMTYgdXMKcGlkaWdpdHMgICAgICAgICAgICAgICAgfCAyNTIgbXMgKy0gMyBtcyAgICAgICB8 IDI2NyBtcyArLSAzIG1zICAgICAgIHwgMjgyIG1zICstIDQgbXMKcHlmbGF0ZSAgICAgICAgICAg ICAgICAgfCAxLjAxIHNlYyArLSAwLjAyIHNlYyB8IDEuMzcgc2VjICstIDAuMDcgc2VjIHwgMS4y MyBzZWMgKy0gMC4wMiBzZWMKcHl0aG9uX3N0YXJ0dXAgICAgICAgICAgfCAxNi45IG1zICstIDAu NiBtcyAgICB8IDE5LjYgbXMgKy0gMC40IG1zICAgIHwgMTcuNiBtcyArLSAwLjUgbXMKcHl0aG9u X3N0YXJ0dXBfbm9fc2l0ZSAgfCAxMS4yIG1zICstIDAuNiBtcyAgICB8IDEyLjcgbXMgKy0gMC4y IG1zICAgIHwgMTEuNSBtcyArLSAwLjMgbXMKcmF5dHJhY2UgICAgICAgICAgICAgICAgfCA3MzMg bXMgKy0gMTEgbXMgICAgICB8IDEuMjIgc2VjICstIDAuMDEgc2VjIHwgODg2IG1zICstIDEwIG1z CnJlZ2V4X2NvbXBpbGUgICAgICAgICAgIHwgMjU3IG1zICstIDIgbXMgICAgICAgfCAzNTMgbXMg Ky0gMyBtcyAgICAgICB8IDMwMCBtcyArLSA0IG1zCnJlZ2V4X2RuYSAgICAgICAgICAgICAgIHwg MjY4IG1zICstIDQgbXMgICAgICAgfCAyOTYgbXMgKy0gNyBtcyAgICAgICB8IDI5MyBtcyArLSAx NSBtcwpyZWdleF9lZmZib3QgICAgICAgICAgICB8IDQuMzUgbXMgKy0gMC4wNyBtcyAgIHwgNS4x MyBtcyArLSAwLjM5IG1zICAgfCA0LjkzIG1zICstIDAuMjMgbXMKcmVnZXhfdjggICAgICAgICAg ICAgICAgfCAzNS45IG1zICstIDAuNyBtcyAgICB8IDQzLjMgbXMgKy0gMi4wIG1zICAgIHwgMzcu NSBtcyArLSAwLjQgbXMKcmljaGFyZHMgICAgICAgICAgICAgICAgfCAxMDAgbXMgKy0gMSBtcyAg ICAgICB8IDE2OCBtcyArLSA5IG1zICAgICAgIHwgMTI0IG1zICstIDQgbXMKc2NpbWFya19mZnQg ICAgICAgICAgICAgfCA1MzggbXMgKy0gNiBtcyAgICAgICB8IDc3MyBtcyArLSA4IG1zICAgICAg IHwgNzEwIG1zICstIDMzIG1zCnNjaW1hcmtfbHUgICAgICAgICAgICAgIHwgMjM1IG1zICstIDUg bXMgICAgICAgfCAzNDAgbXMgKy0gMyBtcyAgICAgICB8IDI4OCBtcyArLSA1IG1zCnNjaW1hcmtf bW9udGVfY2FybG8gICAgIHwgMTU0IG1zICstIDIgbXMgICAgICAgfCAyMzEgbXMgKy0gNCBtcyAg ICAgICB8IDE5MSBtcyArLSA0IG1zCnNjaW1hcmtfc29yICAgICAgICAgICAgIHwgMzAxIG1zICst IDQgbXMgICAgICAgfCA0NDYgbXMgKy0gOCBtcyAgICAgICB8IDM2MyBtcyArLSA2IG1zCnNjaW1h cmtfc3BhcnNlX21hdF9tdWx0IHwgNi42NSBtcyArLSAwLjI2IG1zICAgfCAxMC4zIG1zICstIDAu MiBtcyAgICB8IDguMTQgbXMgKy0gMC4wOSBtcwpzcGVjdHJhbF9ub3JtICAgICAgICAgICB8IDIw NSBtcyArLSA1IG1zICAgICAgIHwgMjk2IG1zICstIDUgbXMgICAgICAgfCAyNTEgbXMgKy0gMiBt cwpzcWxhbGNoZW15X2RlY2xhcmF0aXZlICB8IDI1NyBtcyArLSAzIG1zICAgICAgIHwgMzEzIG1z ICstIDQgbXMgICAgICAgfCAyODkgbXMgKy0gMyBtcwpzcWxhbGNoZW15X2ltcGVyYXRpdmUgICB8 IDUxLjQgbXMgKy0gMS4zIG1zICAgIHwgNjMuNyBtcyArLSA0LjAgbXMgICAgfCA1NS41IG1zICst IDMuMyBtcwpzcWxpdGVfc3ludGggICAgICAgICAgICB8IDQuMjMgdXMgKy0gMC4xMiB1cyAgIHwg NS43NyB1cyArLSAwLjE3IHVzICAgfCA1LjI0IHVzICstIDAuNTEgdXMKc3ltcHlfZXhwYW5kICAg ICAgICAgICAgfCA3NjYgbXMgKy0gMTMgbXMgICAgICB8IDEuMDMgc2VjICstIDAuMDQgc2VjIHwg ODA2IG1zICstIDEzIG1zCnN5bXB5X2ludGVncmF0ZSAgICAgICAgIHwgMzguNCBtcyArLSAwLjcg bXMgICAgfCA0OC4zIG1zICstIDAuNCBtcyAgICB8IDQyLjAgbXMgKy0gMC42IG1zCnN5bXB5X3N1 bSAgICAgICAgICAgICAgIHwgMzQ4IG1zICstIDggbXMgICAgICAgfCA0MzMgbXMgKy0gNCBtcyAg ICAgICB8IDM2OSBtcyArLSA2IG1zCnN5bXB5X3N0ciAgICAgICAgICAgICAgIHwgNTI2IG1zICst IDggbXMgICAgICAgfCA2NzYgbXMgKy0gNiBtcyAgICAgICB8IDU2MiBtcyArLSA2IG1zCnRlbGNv ICAgICAgICAgICAgICAgICAgIHwgOC41NiBtcyArLSAwLjEzIG1zICAgfCAxMy4wIG1zICstIDAu NyBtcyAgICB8IDEyLjAgbXMgKy0gMC40IG1zCnRvcm5hZG9faHR0cCAgICAgICAgICAgIHwgMjkz IG1zICstIDExIG1zICAgICAgfCAzNzYgbXMgKy0gMjMgbXMgICAgICB8IDMzMCBtcyArLSAxMyBt cwp1bnBhY2tfc2VxdWVuY2UgICAgICAgICB8IDgzLjggbnMgKy0gNC4wIG5zICAgIHwgOTIuOCBu cyArLSA1LjMgbnMgICAgfCA4OS44IG5zICstIDMuMiBucwp1bnBpY2tsZSAgICAgICAgICAgICAg ICB8IDE5LjUgdXMgKy0gMC4zIHVzICAgIHwgMjcuMCB1cyArLSAwLjUgdXMgICAgfCAyNS4wIHVz ICstIDEuMSB1cwp1bnBpY2tsZV9saXN0ICAgICAgICAgICB8IDUuOTQgdXMgKy0gMC4xMiB1cyAg IHwgNy45OSB1cyArLSAwLjM4IHVzICAgfCA2LjgyIHVzICstIDAuNTMgdXMKdW5waWNrbGVfcHVy ZV9weXRob24gICAgfCA0NjEgdXMgKy0gMTAgdXMgICAgICB8IDc0OSB1cyArLSAyNCB1cyAgICAg IHwgNTY2IHVzICstIDI2IHVzCnhtbF9ldHJlZV9wYXJzZSAgICAgICAgIHwgMjE5IG1zICstIDMg bXMgICAgICAgfCAyNTkgbXMgKy0gMiBtcyAgICAgICB8IDI2MSBtcyArLSAxMyBtcwp4bWxfZXRy ZWVfaXRlcnBhcnNlICAgICB8IDE1NSBtcyArLSA0IG1zICAgICAgIHwgMTkyIG1zICstIDIgbXMg ICAgICAgfCAxODAgbXMgKy0gMyBtcwp4bWxfZXRyZWVfZ2VuZXJhdGUgICAgICB8IDEzOCBtcyAr LSAzIG1zICAgICAgIHwgMTg1IG1zICstIDMgbXMgICAgICAgfCAxNzUgbXMgKy0gOSBtcwp4bWxf ZXRyZWVfcHJvY2VzcyAgICAgICB8IDEwOSBtcyArLSA0IG1zICAgICAgIHwgMTQ4IG1zICstIDIg bXMgICAgICAgfCAxMzYgbXMgKy0gMiBtcwo= --MP_/tZs_.Vg4a.HgJHHS0Xe7k7L-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 31 08:47:54 2021 Received: (at 47251) by debbugs.gnu.org; 31 Mar 2021 12:47:54 +0000 Received: from localhost ([127.0.0.1]:53792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRaGI-0001oA-2W for submit@debbugs.gnu.org; Wed, 31 Mar 2021 08:47:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRaGG-0001ny-Uu for 47251@debbugs.gnu.org; Wed, 31 Mar 2021 08:47:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59048) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRaGA-0004Mi-IG; Wed, 31 Mar 2021 08:47:46 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60230 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lRaG9-0008HP-O2; Wed, 31 Mar 2021 08:47:46 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> Date: Wed, 31 Mar 2021 14:47:44 +0200 In-Reply-To: <20210319001622.1c19ad41@tachikoma.lepiller.eu> (Julien Lepiller's message of "Fri, 19 Mar 2021 00:16:22 +0100") Message-ID: <87r1jva3rj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Julien, Julien Lepiller skribis: >>>From c72e34aa0eb0db589557e047c5db0128273d5d12 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Thu, 18 Mar 2021 23:41:40 +0100 > Subject: [PATCH 2/2] 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. LGTM! Great that you found about these options. I wonder what can be done to reduce the package size. On =E2=80=98core-updates=E2=80=99, we=E2=80=99re already stripping ELF binarie= s a bit more than on =E2=80=98master=E2=80=99. What does =E2=80=98size =E2=80=A6/bin/python=E2=80=99 say? Could it be the= re=E2=80=99s GIMPLE left in the executable or in libpython.so as a result of using -flto? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 10 16:55:51 2021 Received: (at 47251) by debbugs.gnu.org; 10 Apr 2021 20:55:51 +0000 Received: from localhost ([127.0.0.1]:53427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVKdy-0002qM-OO for submit@debbugs.gnu.org; Sat, 10 Apr 2021 16:55:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVKdw-0002q3-R2 for 47251@debbugs.gnu.org; Sat, 10 Apr 2021 16:55:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50828) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVKdq-0003ya-1a; Sat, 10 Apr 2021 16:55:42 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42172 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lVKdg-0003IR-Sh; Sat, 10 Apr 2021 16:55:39 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. In-Reply-To: <87r1jva3rj.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 31 Mar 2021 14:47:44 +0200") References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Date: Sat, 10 Apr 2021 22:55:31 +0200 Message-ID: <871rbh2724.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Ping! :-) Ludovic Court=C3=A8s skribis: > Hi Julien, > > Julien Lepiller skribis: > >>>>>From c72e34aa0eb0db589557e047c5db0128273d5d12 Mon Sep 17 00:00:00 2001 >> From: Julien Lepiller >> Date: Thu, 18 Mar 2021 23:41:40 +0100 >> Subject: [PATCH 2/2] 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 flag= s to >> optimize the resulting python. > > LGTM! Great that you found about these options. > > I wonder what can be done to reduce the package size. On > =E2=80=98core-updates=E2=80=99, we=E2=80=99re already stripping ELF binar= ies a bit more than on > =E2=80=98master=E2=80=99. > > What does =E2=80=98size =E2=80=A6/bin/python=E2=80=99 say? Could it be t= here=E2=80=99s GIMPLE left in > the executable or in libpython.so as a result of using -flto? > > Thanks, > Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 10 16:55:51 2021 Received: (at 47251) by debbugs.gnu.org; 10 Apr 2021 20:55:51 +0000 Received: from localhost ([127.0.0.1]:53429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVKdy-0002qP-Vs for submit@debbugs.gnu.org; Sat, 10 Apr 2021 16:55:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVKdx-0002q4-0m for 47251@debbugs.gnu.org; Sat, 10 Apr 2021 16:55:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50825) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVKdo-0003x4-2Q; Sat, 10 Apr 2021 16:55:40 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42170 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lVKdD-0003CW-IZ; Sat, 10 Apr 2021 16:55:05 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> Date: Sat, 10 Apr 2021 22:55:02 +0200 In-Reply-To: <87r1jva3rj.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 31 Mar 2021 14:47:44 +0200") Message-ID: <8735vx272x.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Ping! :-) Ludovic Court=C3=A8s skribis: > Hi Julien, > > Julien Lepiller skribis: > >>>>>From c72e34aa0eb0db589557e047c5db0128273d5d12 Mon Sep 17 00:00:00 2001 >> From: Julien Lepiller >> Date: Thu, 18 Mar 2021 23:41:40 +0100 >> Subject: [PATCH 2/2] 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 flag= s to >> optimize the resulting python. > > LGTM! Great that you found about these options. > > I wonder what can be done to reduce the package size. On > =E2=80=98core-updates=E2=80=99, we=E2=80=99re already stripping ELF binar= ies a bit more than on > =E2=80=98master=E2=80=99. > > What does =E2=80=98size =E2=80=A6/bin/python=E2=80=99 say? Could it be t= here=E2=80=99s GIMPLE left in > the executable or in libpython.so as a result of using -flto? > > Thanks, > Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 02 22:06:47 2021 Received: (at 47251) by debbugs.gnu.org; 3 Jun 2021 02:06:48 +0000 Received: from localhost ([127.0.0.1]:41649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lockx-0007os-Ew for submit@debbugs.gnu.org; Wed, 02 Jun 2021 22:06:47 -0400 Received: from lepiller.eu ([89.234.186.109]:39236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lockv-0007oi-FF for 47251@debbugs.gnu.org; Wed, 02 Jun 2021 22:06:46 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id c705aa6e; Thu, 3 Jun 2021 02:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=vYQOYxqoniZw jDQUmxGoiITL2DfqU2fQ1P8zomZRkL0=; b=C4nFJXlV3DyMMUfJ+Ru1YqEvYwUo ob+8UBXVUouaU4YkYjnrmE9zxRdLs0VHXd7jt6rdAW0o96nzoa79oCIFdew4KBCH +AqNg31jwHa+FOHk4PDoxvr5Pd2lKlZlni24iQn/Xg/tp2eXmrmB3YZ8sNTBtusm yilfT9UIkqJ/C3ifPmWifCVTX8wGuAUfiWCA3SMaJC2ARAiKi+SBVYq2G4VwFZVT ZKbtAkU2uqmq3Uud9vsi+NwCrfLbgy3/aZNU5n/1ISTF4vuj1xtkIxHjaTao+GpL 95pVzhxKHfhUctbl1nAIz1JM9XPJuxVF6gVVECrh5pj4hDNvNirz+M37bg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3892755d (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 3 Jun 2021 02:06:43 +0000 (UTC) Date: Thu, 3 Jun 2021 04:06:35 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. Message-ID: <20210603040635.3b6c7d12@tachikoma.lepiller.eu> In-Reply-To: <87r1jva3rj.fsf@gnu.org> References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Wed, 31 Mar 2021 14:47:44 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > Hi Julien, >=20 > Julien Lepiller skribis: >=20 > >>From c72e34aa0eb0db589557e047c5db0128273d5d12 Mon Sep 17 00:00:00 > >>2001 =20 > > From: Julien Lepiller > > Date: Thu, 18 Mar 2021 23:41:40 +0100 > > Subject: [PATCH 2/2] 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. =20 >=20 > LGTM! Great that you found about these options. >=20 > I wonder what can be done to reduce the package size. On > =E2=80=98core-updates=E2=80=99, we=E2=80=99re already stripping ELF binar= ies a bit more than > on =E2=80=98master=E2=80=99. >=20 > What does =E2=80=98size =E2=80=A6/bin/python=E2=80=99 say? Could it be t= here=E2=80=99s GIMPLE left in > the executable or in libpython.so as a result of using -flto? >=20 > Thanks, > Ludo=E2=80=99. Sorry for the late reply, I didn't see your message, and never received the pings I see on issues.guix.gnu.org. Here is the output of size on bin/python: text data bss dec hex filename 2072 704 8 2784 ae0 /gnu/store/bcggflp7zszpazgk8qa4sr0kmp5a67pg-python-minimal-3.9.5/bin/pyt= hon3 Same, for lib/libpython3.so: text data bss dec hex filename 1154 576 8 1738 6ca /gnu/store/bcggflp7zszpazgk8qa4sr0kmp5a67pg-python-minimal-3.9.5/lib/libpyt= hon3.so Same for lib/libpython3.9.so.1.0: text data bss dec hex filename 3614304 254928 139896 4009128 3d2ca8 /gnu/store/bcggflp7zszpazgk8qa4sr0kmp5a67pg-python-minimal-3.9.5/lib/libpyt= hon3.9.so.1.0 But I noticed another file gained a lot of weight: lib/python3.9/config-3.9-x86_64-linux-gnu/libpython3.9.a weighs 39MB, whereas on master (for 3.8.2) it weighs 6MB. Here is what size has to say: text data bss dec hex 298 0 52 350 15e 2642 0 0 2642 a52 370 0 100 470 1d6 481 0 0 481 1e1 1828 0 0 1828 724 1909 0 0 1909 775 1817 512 0 2329 919 24497 0 16032 40529 9e51 110286 976 0 111262 1b29e 12936 0 0 12936 3288 895 0 0 895 37f 1159 0 32 1191 4a7 4311 0 0 4311 10d7 29747 56 0 29803 746b 39941 344 0 40285 9d5d 1252 0 0 1252 4e4 1209 760 16 1985 7c1 16582 0 0 16582 40c6 56468 3856 1 60325 eba5 62176 3520 2080 67776 108c0 20674 0 0 20674 50c2 3160 408 0 3568 df0 1594 488 0 2082 822 4895 1392 16 6303 189f 17197 1384 16 18597 48a5 12586 1072 0 13658 355a 20052 6096 0 26148 6624 4232 1176 0 5408 1520 33447 28560 56 62063 f26f 4950 1096 0 6046 179e 18895 4928 1344 25167 624f 5088 880 0 5968 1750 30728 1496 452 32676 7fa4 9294 1016 16 10326 2856 11512 2328 8 13848 3618 1661 728 0 2389 955 2620 1040 0 3660 e4c 48674 2280 672 51626 c9aa 102026 2024 1240 105290 19b4a 69538 6296 1352 77186 12d82 14228 3728 0 17956 4624 30454 1968 0 32422 7ea6 6484 1304 0 7788 1e6c 9917 1368 8 11293 2c1d 2185 552 0 2737 ab1 31339 1816 0 33155 8183 19061 900 584 20545 5041 1886 528 0 2414 96e 12991 2240 0 15231 3b7f 46206 3624 8 49838 c2ae 5898 1176 8 7082 1baa 5952 248 0 6200 1838 13769 1264 256 15289 3bb9 111003 11760 98432 221195 3600b 280942 5056 2168 288166 465a6 141203 0 0 141203 22793 16406 2000 8 18414 47ee 13022 944 16 13982 369e 129842 2352 1712 133906 20b12 810 0 0 810 32a 71059 72 8 71139 115e3 24372 40 0 24412 5f5c 8726 0 48 8774 2246 41512 3992 0 45504 b1c0 61876 2460 4 64340 fb54 20340 360 8 20708 50e4 74371 88 80 74539 1232b 10273 2488 24 12785 31f1 48 0 0 48 30 26200 472 408 27080 69c8 1257 0 0 1257 4e9 1404 0 0 1404 57c 55841 0 8 55849 da29 117 0 0 117 75 412 0 0 412 19c 110 0 0 110 6e 192 0 250 442 1ba 6170 25384 0 31554 7b42 10561 3280 16 13857 3621 3590 0 0 3590 e06 30434 1392 72 31898 7c9a 2079 24 0 2103 837 36616 0 96 36712 8f68 27149 384 0 27533 6b8d 22163 0 8 22171 569b 494 0 0 494 1ee 4461 0 0 4461 116d 5822 0 48 5870 16ee 7570 0 0 7570 1d92 7739 0 32 7771 1e5b 1144 0 0 1144 478 1584 0 0 1584 630 113 0 0 113 71 4422 24 24 4470 1176 20465 416 672 21553 5431 402 0 0 402 192 14654 0 0 14654 393e 16034 696 0 16730 415a 7026 0 0 7026 1b72 1754 40 4 1798 706 2920 0 0 2920 b68 28827 768 56 29651 73d3 39065 2568 1792 43425 a9a1 4590 96 452 5138 1412 7585 952 0 8537 2159 1562 52 8 1622 656 316 0 0 316 13c 4609 56 0 4665 1239 1979 0 0 1979 7bb 36752 8 2400 39160 98f8 24453 0 0 24453 5f85 11769 12 0 11781 2e05 973 32 3104 4109 100d 299 528 0 827 33b 11964 0 0 11964 2ebc 6063 24 0 6087 17c7 18488 896 0 19384 4bb8 141834 17384 8 159226 26dfa 10041 160 32 10233 27f9 3542 416 0 3958 f76 81990 4624 0 86614 15256 27982 1600 16 29598 739e 1808 320 0 2128 850 12262 2776 8 15046 3ac6 18682 3320 0 22002 55f2 19569 4368 136 24073 5e09 11529 824 0 12353 3041 44792 11312 0 56104 db28 3189 328 0 3517 dbd 16392 968 1520 18880 49c0 6380 608 0 6988 1b4c 17490 1288 444 19222 4b16 17253 3088 424 20765 511d 7382 1456 0 8838 2286 19480 576 216 20272 4f30 11320 1936 0 13256 33c8 14121 1336 0 15457 3c61 12682 1720 0 14402 3842 29184 6088 8 35280 89d0 39623 4080 0 43703 aab7 10987 1112 0 12099 2f43 10034 1864 176 12074 2f2a 17528 488 248 18264 4758 1197 352 0 1549 60d 1614 192 0 1806 70e 31873 5840 440 38153 9509 1644 1504 0 3148 c4c 91445 317 0 91762 16672 I had to remove the file name it comes from, because of width issue in email, but I don't really understand what size does, so I don't know if that's relevant or not. Do we need to keep that static library around? From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 03 05:48:49 2021 Received: (at 47251) by debbugs.gnu.org; 3 Jun 2021 09:48:49 +0000 Received: from localhost ([127.0.0.1]:42417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lojy4-0008CT-Ru for submit@debbugs.gnu.org; Thu, 03 Jun 2021 05:48:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lojy4-0008CH-41 for 47251@debbugs.gnu.org; Thu, 03 Jun 2021 05:48:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34356) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lojxy-000561-CR; Thu, 03 Jun 2021 05:48:42 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59544 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lojxy-0002s4-3s; Thu, 03 Jun 2021 05:48:42 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> <20210603040635.3b6c7d12@tachikoma.lepiller.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 Prairial an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 03 Jun 2021 11:48:40 +0200 In-Reply-To: <20210603040635.3b6c7d12@tachikoma.lepiller.eu> (Julien Lepiller's message of "Thu, 3 Jun 2021 04:06:35 +0200") Message-ID: <875yyvwa6f.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Julien Lepiller skribis: > But I noticed another file gained a lot of weight: > lib/python3.9/config-3.9-x86_64-linux-gnu/libpython3.9.a weighs 39MB, > whereas on master (for 3.8.2) it weighs 6MB. Here is what size has to > say: Yeah, the .o files in there likely contain serialized GIMPLE, as a result of compiling with =E2=80=98-flto=E2=80=99. How about removing *.a altogether in a separate patch? Or moving it to a =E2=80=9Cstatic=E2=80=9D output? This would be consistent with what=E2= =80=99s done in other packages. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 05 11:43:36 2021 Received: (at 47251) by debbugs.gnu.org; 5 Jun 2021 15:43:36 +0000 Received: from localhost ([127.0.0.1]:49921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpYSM-0007S4-Ie for submit@debbugs.gnu.org; Sat, 05 Jun 2021 11:43:36 -0400 Received: from lepiller.eu ([89.234.186.109]:43714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpYSI-0007Rt-OT for 47251@debbugs.gnu.org; Sat, 05 Jun 2021 11:43:25 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 100955a8; Sat, 5 Jun 2021 15:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=6L8Ipg9t7Z0mIWWjTRGF9cXm5R3wOf/Ci5GiUT fDnKY=; b=gB1ch4tQfITa2yeR5zeIIArHTH/eWxoCXzPFSyTKauTf1nutkdYTrP AL6qnJLM05RJT71vmW7JYNErIkRBqhS35Wbk2XoF54DTu8O8YwYmtuoUFucwRAzr tUSENCZRnebmaG5NubW5zG43IHxnN8JEZKnlVsq+xGG0xA4gJTtzO2au48432Qla lsgreGcm7JzBZGDAQIMqJMdhnuPl3M6o34c4u5wj3tnOAqNnlWLaeiLK8YUIPzjb tmTUeT8prtotIG5+wM35plXbXm13eJCV0Y8eNOf2sL/92IgDbm7wae2E7J4HM7vR phfGewSwKoUdk3zUxjoHWKFg/E+PVDJg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 50600f67 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 5 Jun 2021 15:43:18 +0000 (UTC) Date: Sat, 5 Jun 2021 17:43:08 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. Message-ID: <20210605174308.57c4a324@tachikoma.lepiller.eu> In-Reply-To: <875yyvwa6f.fsf@gnu.org> References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> <20210603040635.3b6c7d12@tachikoma.lepiller.eu> <875yyvwa6f.fsf@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/U.7iQ6r20E2CVBYnfV6TrmN" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/U.7iQ6r20E2CVBYnfV6TrmN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Thu, 03 Jun 2021 11:48:40 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > Hi, >=20 > Julien Lepiller skribis: >=20 > > But I noticed another file gained a lot of weight: > > lib/python3.9/config-3.9-x86_64-linux-gnu/libpython3.9.a weighs > > 39MB, whereas on master (for 3.8.2) it weighs 6MB. Here is what > > size has to say: =20 >=20 > Yeah, the .o files in there likely contain serialized GIMPLE, as a > result of compiling with =E2=80=98-flto=E2=80=99. >=20 > How about removing *.a altogether in a separate patch? Or moving it > to a =E2=80=9Cstatic=E2=80=9D output? This would be consistent with what= =E2=80=99s done in > other packages. >=20 > Thanks, > Ludo=E2=80=99. 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). --MP_/U.7iQ6r20E2CVBYnfV6TrmN Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-gnu-python-Enable-optimizations.patch >From 0c45d6e82a5f4d140840aef6b0de321122b6c4df Mon Sep 17 00:00:00 2001 From: Julien Lepiller 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. --- gnu/packages/python.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 0f20f8e7d3..031904dff6 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -184,7 +184,10 @@ "--with-system-expat" ;for XML support "--with-system-ffi" ;build ctypes "--with-ensurepip=install" ;install pip and setuptools + "--with-computed-gotos" ;main interpreter loop optimization + "--with-lto" ;increase size by 20MB, but 15% speedup "--enable-unicode=ucs4" + "--enable-optimizations" ;; Prevent the installed _sysconfigdata.py from retaining a reference ;; to coreutils. @@ -198,8 +201,10 @@ "ac_cv_file__dev_ptmx=no" "ac_cv_file__dev_ptc=no") '()) + "CFLAGS=-fno-semantic-interposition" (string-append "LDFLAGS=-Wl,-rpath=" - (assoc-ref %outputs "out") "/lib")) + (assoc-ref %outputs "out") "/lib" + " -fno-semantic-interposition")) ;; With no -j argument tests use all available cpus, so provide one. #:make-flags (list (string-append -- 2.31.1 --MP_/U.7iQ6r20E2CVBYnfV6TrmN Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-gnu-python-Do-not-install-static-libraries.patch =46rom 1faeb01becd558f0f4eec16ff32df9dbf1adda7f Mon Sep 17 00:00:00 2001 From: Julien Lepiller 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. --- gnu/local.mk | 2 + .../patches/python-2.7-no-static-lib.patch | 70 +++++++++++++++++ .../patches/python-3-no-static-lib.patch | 75 +++++++++++++++++++ gnu/packages/python.scm | 6 +- 4 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/python-2.7-no-static-lib.patch create mode 100644 gnu/packages/patches/python-3-no-static-lib.patch diff --git a/gnu/local.mk b/gnu/local.mk index d5a832146e..8370ac12e2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1551,11 +1551,13 @@ dist_patch_DATA =3D \ %D%/packages/patches/python-2.7-site-prefixes.patch \ %D%/packages/patches/python-2.7-source-date-epoch.patch \ %D%/packages/patches/python-2.7-CVE-2021-3177.patch \ + %D%/packages/patches/python-2.7-no-static-lib.patch \ %D%/packages/patches/python-3-arm-alignment.patch \ %D%/packages/patches/python-3-deterministic-build-info.patch \ %D%/packages/patches/python-3-search-paths.patch \ %D%/packages/patches/python-3-fix-tests.patch \ %D%/packages/patches/python-3-hurd-configure.patch \ + %D%/packages/patches/python-3-no-static-lib.patch \ %D%/packages/patches/python-CVE-2018-14647.patch \ %D%/packages/patches/python-CVE-2020-26116.patch \ %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \ diff --git a/gnu/packages/patches/python-2.7-no-static-lib.patch b/gnu/pack= ages/patches/python-2.7-no-static-lib.patch new file mode 100644 index 0000000000..02529989be --- /dev/null +++ b/gnu/packages/patches/python-2.7-no-static-lib.patch @@ -0,0 +1,70 @@ +From 92e2dcace7a3c02289b314238c5f18caec659ff1 Mon Sep 17 00:00:00 2001 +From: Julien Lepiller +Date: Sat, 5 Jun 2021 12:41:47 +0200 +Subject: [PATCH] No static lib. + +This patch is adapted from Fedora. The original patch did not apply +because of whitespace changes. + +00111 # +Patch the Makefile.pre.in so that the generated Makefile doesn't try to bu= ild +a libpythonMAJOR.MINOR.a (bug 550692): +Downstream only: not appropriate for upstream +--- + Makefile.pre.in | 26 +------------------------- + 1 file changed, 1 insertion(+), 25 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 6239fc3..948f196 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -486,7 +486,7 @@ coverage-report: regen-grammar +=20 +=20 + # Build the interpreter +-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) ++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) + $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ + Modules/python.o \ + $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) +@@ -527,18 +527,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_ma= th.o + _TCLTK_INCLUDES=3D'$(TCLTK_INCLUDES)' _TCLTK_LIBS=3D'$(TCLTK_LIBS)' \ + $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build +=20 +-# Build static library +-# avoid long command lines, same as LIBRARY_OBJS +-$(LIBRARY): $(LIBRARY_OBJS) +- -rm -f $@ +- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o +- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) +- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) +- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) +- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) +- $(AR) $(ARFLAGS) $@ $(MODOBJS) +- $(RANLIB) $@ +- + libpython$(VERSION).so: $(LIBRARY_OBJS) + if test $(INSTSONAME) !=3D $(LDLIBRARY); then \ + $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MOD= LIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ +@@ -1216,18 +1204,6 @@ libainstall: @DEF_MAKE_RULE@ python-config + else true; \ + fi; \ + done +- @if test -d $(LIBRARY); then :; else \ +- if test "$(PYTHONFRAMEWORKDIR)" =3D no-framework; then \ +- if test "$(SO)" =3D .dll; then \ +- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ +- else \ +- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ +- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ +- fi; \ +- else \ +- echo Skip install of $(LIBRARY) - use make frameworkinstall; \ +- fi; \ +- fi + $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c + $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o + $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.= c.in +--=20 +2.31.1 + diff --git a/gnu/packages/patches/python-3-no-static-lib.patch b/gnu/packag= es/patches/python-3-no-static-lib.patch new file mode 100644 index 0000000000..b44dbc976c --- /dev/null +++ b/gnu/packages/patches/python-3-no-static-lib.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Malcolm +Date: Mon, 18 Jan 2010 17:59:07 +0000 +Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a +MIME-Version: 1.0 +Content-Type: text/plain; charset=3DUTF-8 +Content-Transfer-Encoding: 8bit + +Downstream only: not appropriate for upstream. + +See https://bugzilla.redhat.com/show_bug.cgi?id=3D556092 + +Co-authored-by: David Malcolm +Co-authored-by: Bohuslav Kabrda +Co-authored-by: Matej Stuchlik +Co-authored-by: Robert Kuska +Co-authored-by: Charalampos Stratakis +Co-authored-by: Miro Hron=C4=8Dok +--- + Makefile.pre.in | 21 ++------------------- + 1 file changed, 2 insertions(+), 19 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 0c3981c132..5587422ec7 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -589,7 +589,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blak= e2s_impl.c + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(s= rcdir) +=20 + # Build the interpreter +-$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $= (EXPORTSYMS) ++$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(= BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) +=20 + platform: $(BUILDPYTHON) pybuilddir.txt +@@ -637,12 +637,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_ma= th.o + _TCLTK_INCLUDES=3D'$(TCLTK_INCLUDES)' _TCLTK_LIBS=3D'$(TCLTK_LIBS)' \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build +=20 +- +-# Build static library +-$(LIBRARY): $(LIBRARY_OBJS) +- -rm -f $@ +- $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) +- + libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS) + if test $(INSTSONAME) !=3D $(LDLIBRARY); then \ + $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MOD= LIBS) $(SHLIBS) $(LIBC) $(LIBM); \ +@@ -724,7 +718,7 @@ Makefile Modules/config.c: Makefile.pre \ + @echo "The Makefile was updated, you may need to re-run make." +=20 +=20 +-Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3L= IBRARY) $(EXPORTSYMS) ++Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) $(E= XPORTSYMS) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.= o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) +=20 + #########################################################################= ### +@@ -1652,17 +1646,6 @@ libainstall: @DEF_MAKE_RULE@ python-config + else true; \ + fi; \ + done +- @if test -d $(LIBRARY); then :; else \ +- if test "$(PYTHONFRAMEWORKDIR)" =3D no-framework; then \ +- if test "$(SHLIB_SUFFIX)" =3D .dll; then \ +- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ +- else \ +- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ +- fi; \ +- else \ +- echo Skip install of $(LIBRARY) - use make frameworkinstall; \ +- fi; \ +- fi + $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c + $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o + $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.= c.in diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 031904dff6..4ac4b7c23c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -150,7 +150,8 @@ "python-2.7-source-date-epoch.patch" "python-2.7-adjust-tests.patch" "python-cross-compile.patch" - "python-2.7-CVE-2021-3177.patch")) + "python-2.7-CVE-2021-3177.patch" + "python-2.7-no-static-lib.patch")) (modules '((guix build utils))) (snippet '(begin @@ -418,7 +419,8 @@ data types.") "python-3-deterministic-build-info.patch" "python-3-fix-tests.patch" "python-3-hurd-configure.patch" - "python-3-search-paths.patch")) + "python-3-search-paths.patch" + "python-3-no-static-lib.patch")) (sha256 (base32 "10vdf46q5ldnzkprm8pldvr5a9hrdpxjv7mpzgdw6vj3cl318nhc")) --=20 2.31.1 --MP_/U.7iQ6r20E2CVBYnfV6TrmN Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0004-gnu-python-Move-idle-to-a-separate-output.patch >From c650ac48be47b373c6c8c0b3495f30d9fe21e68b Mon Sep 17 00:00:00 2001 From: Julien Lepiller 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. --- gnu/packages/python.scm | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 4ac4b7c23c..72e05552d8 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -176,7 +176,8 @@ "Lib/test/test_subprocess.py")) #t)))) (outputs '("out" - "tk")) ;tkinter; adds 50 MiB to the closure + "tk" ;tkinter; adds 50 MiB to the closure + "idle")) ;programming environment; weighs 5MB (build-system gnu-build-system) (arguments `(#:test-target "test" @@ -357,6 +358,27 @@ (install-file tkinter.so target) (delete-file tkinter.so))))) #t))) + (add-after 'install 'move-idle + (lambda* (#:key outputs #:allow-other-keys) + ;; when idle is built, move it to a separate output to save some + ;; space (5MB) + (let ((out (assoc-ref outputs "out")) + (idle (assoc-ref outputs "idle"))) + (when idle + (for-each + (lambda (file) + (let ((target (string-append idle "/bin/" (basename file)))) + (install-file file (dirname target)) + (delete-file file))) + (find-files (string-append out "/bin") "^idle")) + (match (find-files out "^idlelib$" #:directories? #t) + ((idlelib) + (let* ((len (string-length out)) + (target (string-append idle "/" + (string-drop idlelib len) + "/site-packages"))) + (mkdir-p (dirname target)) + (rename-file idlelib target)))))))) (add-after 'install 'install-sitecustomize.py ,(customize-site version))))) (inputs @@ -620,8 +642,8 @@ for more information."))) (lambda (old new) (symlink (string-append python old) (string-append bin "/" new))) - `("python3" ,"pydoc3" ,"idle3" ,"pip3") - `("python" ,"pydoc" ,"idle" ,"pip")) + `("python3" ,"pydoc3" ,"pip3") + `("python" ,"pydoc" ,"pip")) ;; python-config outputs search paths based upon its location, ;; use a bash wrapper to avoid changing its outputs. (let ((bash (string-append (assoc-ref %build-inputs "bash") -- 2.31.1 --MP_/U.7iQ6r20E2CVBYnfV6TrmN-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 06 08:34:44 2021 Received: (at 47251) by debbugs.gnu.org; 6 Jun 2021 12:34:44 +0000 Received: from localhost ([127.0.0.1]:50935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lprzI-0004r5-EV for submit@debbugs.gnu.org; Sun, 06 Jun 2021 08:34:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lprzD-0004qm-Md for 47251@debbugs.gnu.org; Sun, 06 Jun 2021 08:34:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49990) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lprz7-0005vw-OU; Sun, 06 Jun 2021 08:34:33 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56328 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lprz7-0001oD-G7; Sun, 06 Jun 2021 08:34:33 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> <20210603040635.3b6c7d12@tachikoma.lepiller.eu> <875yyvwa6f.fsf@gnu.org> <20210605174308.57c4a324@tachikoma.lepiller.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 Prairial an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 06 Jun 2021 14:34:31 +0200 In-Reply-To: <20210605174308.57c4a324@tachikoma.lepiller.eu> (Julien Lepiller's message of "Sat, 5 Jun 2021 17:43:08 +0200") Message-ID: <87h7ibkw88.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 47251 Cc: 47251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Julien Lepiller 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 > 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=3D-fno-semantic-interposition" > (string-append "LDFLAGS=3D-Wl,-rpath=3D" > - (assoc-ref %outputs "out") "/lib")) > + (assoc-ref %outputs "out") "/lib" > + " -fno-semantic-interposition")) Could you add a comment for =E2=80=98-fno-semantic-interposition=E2=80=99? = Also, please make sure that setting CFLAGS does not override useful defaults (for Autoconf-based build systems, CFLAGS defaults to =E2=80=98-O2 -g=E2=80=99 a= nd overriding it means you lost both -O2 and -g; if we lose =E2=80=98-g=E2=80=99, =E2=80= =98--with-debug-info=E2=80=99 won=E2=80=99t have any effect). > From 1faeb01becd558f0f4eec16ff32df9dbf1adda7f Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > 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 > 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=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 10 21:03:42 2021 Received: (at 47251-done) by debbugs.gnu.org; 11 Jun 2021 01:03:42 +0000 Received: from localhost ([127.0.0.1]:37893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrVaI-0000Jv-IV for submit@debbugs.gnu.org; Thu, 10 Jun 2021 21:03:42 -0400 Received: from lepiller.eu ([89.234.186.109]:44258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrVaG-0000Jn-Dm for 47251-done@debbugs.gnu.org; Thu, 10 Jun 2021 21:03:40 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 32cd8237; Fri, 11 Jun 2021 01:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=B8B7SzA/sPzm uMg49+r3+DquVZewvWaZngEr1/qiUP0=; b=O8a8XKtWzL/9zvH1JaORU4qCN+7d BdOCkyP3baDClU0koCfLYFlK9ZUCMET/rQSz525MSzTBoTS/L38XEip4/+n69wNx rIx318Nnt32FXdVNXhXJu2BPbyyIM4SS0ks7hmYSFZN/ZdNxS2HFKV7UkAe+E+tb /MI60iOiQyuu9nQRTvoAI9umD0BHf6U5yPoOzsZ6ekhhp/IOpi9hgy53BP6eT7N5 9zLiBvOQXBPztXGSlb5SPTh2YAYnzBnE3XOJS+BJopx5Kq1v9QVp7lxfafxc3oUL 1q4XNIikUqzB4P379thidegqcZYdt9y/GodoqGPXQ2mqUM9gnqpoEW8Wdg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3ce42d45 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 11 Jun 2021 01:03:38 +0000 (UTC) Date: Fri, 11 Jun 2021 03:03:33 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#47251: [core-updates] [patch] gnu: python: Enable optimizations. Message-ID: <20210611030333.72f69b00@tachikoma.lepiller.eu> In-Reply-To: <87h7ibkw88.fsf@gnu.org> References: <20210319001622.1c19ad41@tachikoma.lepiller.eu> <87r1jva3rj.fsf@gnu.org> <20210603040635.3b6c7d12@tachikoma.lepiller.eu> <875yyvwa6f.fsf@gnu.org> <20210605174308.57c4a324@tachikoma.lepiller.eu> <87h7ibkw88.fsf@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47251-done Cc: 47251-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Sun, 06 Jun 2021 14:34:31 +0200, Ludovic Court=C3=A8s a =C3=A9crit : >=20 > > + "CFLAGS=3D-fno-semantic-interposition" > > (string-append "LDFLAGS=3D-Wl,-rpath=3D" > > - (assoc-ref %outputs "out") "/lib")) > > + (assoc-ref %outputs "out") "/lib" > > + " -fno-semantic-interposition")) =20 >=20 > Could you add a comment for =E2=80=98-fno-semantic-interposition=E2=80=99= ? Also, > please make sure that setting CFLAGS does not override useful > defaults (for Autoconf-based build systems, CFLAGS defaults to =E2=80=98-= O2 > -g=E2=80=99 and overriding it means you lost both -O2 and -g; if we lose > =E2=80=98-g=E2=80=99, =E2=80=98--with-debug-info=E2=80=99 won=E2=80=99t h= ave any effect). >=20 With the patch, python still builds with -g -O3. Pushed as 99d450b085b7bf44d669093f6c9964391ce1b451 to e4aa346d57f61956626032d0d1dfca6b3c96e06a to core-updates, thanks! From unknown Sun Jun 22 00:06:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 09 Jul 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator