From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AwTAOvzAvGBtUgAAgWs5BA (envelope-from ) for ; Sun, 06 Jun 2021 14:35:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id PiKKNfzAvGBzEAAA1q6Kng (envelope-from ) for ; Sun, 06 Jun 2021 12:35:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 651A310C38 for ; Sun, 6 Jun 2021 14:35:08 +0200 (CEST) Received: from localhost ([::1]:48722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lprzf-0002Gs-F8 for larch@yhetil.org; Sun, 06 Jun 2021 08:35:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lprza-0002GC-1s for guix-patches@gnu.org; Sun, 06 Jun 2021 08:35:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lprzZ-0006DJ-Qy for guix-patches@gnu.org; Sun, 06 Jun 2021 08:35:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lprzZ-0004rg-PL for guix-patches@gnu.org; Sun, 06 Jun 2021 08:35:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47251] [core-updates] [patch] gnu: python: Enable optimizations. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Jun 2021 12:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47251 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 47251@debbugs.gnu.org Received: via spool by 47251-submit@debbugs.gnu.org id=B47251.162298288418672 (code B ref 47251); Sun, 06 Jun 2021 12:35:01 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622982908; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=ykPjezrmY2Dh827eE4mNlcGvv5HVxUS8RbVfD3JlQgE=; b=XEZuBCfnoROAHCda8SJpmSVztd6Q9EmQkN8q1fSvXwzoMlPaoJcN+P/+linKT4tRxTSttp jlcjKJHmaRLvNsDXkKK1mZ/Tk8QEU0AWMjVN/Vnti1xOisoKp2+McHFdZ3N7jtAsZGUWGS FPrmFh5VhpZK/5s/hRy1cXpyFE9aVd05v5sHUUOTO4+NFa6m61KNOb5F3Cd3Fpy8enCIN7 AvG6jdPhc8qIlSv7YUVonTVkEGosoEjM8HugPbxdGYtIxF1dVlk7V6AFTovkUn3fn4rrap dHfQYJ9nWU+nfkqU6BuFJBNL8Np130zBuKTORkXjs8LhtTWk4rFtjPD899h30g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622982908; a=rsa-sha256; cv=none; b=bd9bfYNUDKXfFnAGX/rw8llLzoC1qxVzeXD25GGAEc1h+fcW6YlTeZ5tlies0X3kJxPhxA 6K/QVeLa5uOWZERRWbMyfhgFv3OqolkU+URuTx3lUQXd1FfoVRAP+KF27K6PLnMtWWP/RT PTdIffwyVePSnotFEhu06AtyTt6Ntw5NjsWouqq1CPnwOiWWr9Bt/5ps67YXRifxGa9wfq AEGBkLENuDLyHZ8WeYRPonjZarerteo+h1Ob3OJuMlARv6q5rsQ1/129uhpyehmREe3RPT k+h84vFdMaddGcuhviTPh16WJYRDRFNgTvmuhUuiDGIasNZDxpApmKgI43YkXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.93 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 651A310C38 X-Spam-Score: -2.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: TJYsyIpWzUuT 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.