From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Guile optimizations slowing down the program? Date: Wed, 9 Mar 2022 00:31:56 +0100 Message-ID: <4f80c059-4e10-1c0b-33d4-e73c66da297c@abou-samra.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8736"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: guile-user@gnu.org, guile-devel@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Mar 09 00:32:22 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRjJU-000270-4l for guile-user@m.gmane-mx.org; Wed, 09 Mar 2022 00:32:20 +0100 Original-Received: from localhost ([::1]:57350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRjJS-0004Ww-P3 for guile-user@m.gmane-mx.org; Tue, 08 Mar 2022 18:32:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRjJD-0004Wk-Pd; Tue, 08 Mar 2022 18:32:03 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.13]:39805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRjJB-0005V1-TT; Tue, 08 Mar 2022 18:32:03 -0500 Original-Received: from [10.188.216.67] ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1Mleo0-1nrP8p2Ot0-00igfc; Wed, 09 Mar 2022 00:31:57 +0100 Content-Language: en-US X-Provags-ID: V03:K1:Zk2sDSzxoEIwqhQp4cjC8zUjSF9Awpj46pMQhKi4qPzDzdOAPbC UWIwuKwylmTQYm9K4IwDitFRxvZTysp2nFwDW9OW0w0m40mRUmNxpgoPb4/lCRA7gGKB2un DEH2Wb9i9rV1aP0XexpuWD/DAhGEx8unAYmryozhiWxm6dGX4ZCr3drWRKcx5VmSPHAYFvE h7CSUdq/QjNXWF0j0GkmA== X-UI-Out-Filterresults: notjunk:1;V03:K0:zrwD5Tpf5FM=:zsi8fMDI6kxislCJ9itEti mbCQmWAItM9CXKngKZz3W7JM4U8n2ZukLHYXL/Rt1uOm/NOg9HKcMvJPQqAJVU2s8jPUB0EGH uUv/A31LOaxSDSoUSjxwGjJGmAM3sGdair5AGR0sn8vjCjTtUYmtoMvSxZfM0KJuX/uS3Wlkn 7FTBLzNueXj8dYp7tqTKgSwlh6TeifaRRcY+VjP65CLhTuK7sU4q6CeYflA8R29TpphQ7ZTIY y8QXuTCnb2dIKsEjClyOhtC6hHyYngU74ptasGN0H5CMIZkgRUL5v8Bih5Z0n4kCipx1aAAHn laCLfs5v6FlxL+EPrfU02xgQXE5Lqt/10UL1/dvT51YRXv4IW5XKfSf4xHfrwlUx30CFdfMty T4SzafWYoIGhkiCQJRNmwtVJjLecuLO8fsMXwPX5Nbjer2xGStEZZv1/BYR9xEJdLzKMtbXaH EwiLlVsqXGjOduTE8GgjNtCR8QSu0NezF1pvGvueGRiT07g7LT6TOKTz+KV9H1EVx2dk8hQWq wKoPB/BXsO6f24owdbMlNmtTtutQ8MtXodtnWKg2iL0rIiXxGTJS65dRcByRnekFJ4jj6CagS LwUJRiLGWe64UNQ1bzO0U28ZHqYt1xkH7xJWaFzpXrUnjpvW9GHH1eMpLvWn1Kt9lPoNe2Yjt 6ROvV/3FXwEsuJbhaugl5I8Nd9OlVvB/7g78k4KYeX/JXqiy1K+/DvleJ09fh4OctRLw= Received-SPF: none client-ip=212.227.17.13; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18170 gmane.lisp.guile.devel:21158 Archived-At: Hi, LilyPond has a fairly sized body of Scheme code. With Guile 2, the byte-compilation with default settings takes 1 minute, and 1min30 with Guile 3, so I've been experimenting with reducing optimizations to make it faster for development cycles. I've found that disabling optimizations reduces the byte-compilation time to 20s in Guile 2, and just 4s in Guile 3 (thanks to the baseline compiler). Naturally, I've tried to see how much that slowed down the resulting version of LilyPond. To my surprise, it looks like these unoptimized versions are actually faster. In Guile 2, I'm not sure if the difference is significant, but it definitely looks so in Guile 3. This is one benchmark, comparing optimization level 0 against level 2 (the latter is the default):                   Baseline   New executable    Delta _________________________________________________________________________________________ │ Min            │ 4.060    │ 4.020          │ -0.99%                                     │ │ Mean           │ 4.138    │ 4.096          │ -1.03%                                     │ │                │          │                │ (difference is -2.86 times standard error) │ │ Standard error │ 0.014    │ 0.015 │                                            │ └────────────────┴──────────┴────────────────┴────────────────────────────────────────────┘ Here's a different benchmark (on a much larger LilyPond file):                   Baseline   New executable    Delta ___________________________________________________________________________________________ │ Min            │ 35.380   │ 34.600         │ -2.20%                                     │ │ Mean           │ 36.065   │ 34.913         │ -3.20%                                     │ │                │          │                │ (difference is -9.10 times standard error) │ │ Standard error │ 0.173    │ 0.080 │                                            │ └────────────────┴──────────┴────────────────┴────────────────────────────────────────────┘ Same benchmarks, with optimization level 1:                    Baseline   New executable   Delta ___________________________________________________________________________________________ │ Min            │ 4.040    │ 4.040          │ 0.00%                                      │ │ Mean           │ 4.256    │ 4.244          │ -0.28%                                     │ │                │          │                │ (difference is -0.57 times standard error) │ │ Standard error │ 0.022    │ 0.020 │                                            │ └─────────────────────────────────────────────────────────────────────────────────────────|                   Baseline    New executable   Delta ___________________________________________________________________________________________ │ Min            │ 35.500   │ 34.450         │ -2.96%                                     │ │ Mean           │ 36.069   │ 35.081         │ -2.74%                                     │ │                │          │                │ (difference is -6.27 times standard error) │ │ Standard error │ 0.117    │ 0.198 │                                            │ └────────────────┴──────────┴────────────────┴────────────────────────────────────────────┘ In summary, the less Guile optimizes, the faster LilyPond runs. Is that something expected? Best, Jean