From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 14 16:04:46 2025 Received: (at submit) by debbugs.gnu.org; 14 Jul 2025 20:04:46 +0000 Received: from localhost ([127.0.0.1]:36713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ubPPp-0005AL-RM for submit@debbugs.gnu.org; Mon, 14 Jul 2025 16:04:46 -0400 Received: from lists.gnu.org ([2001:470:142::17]:59272) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ubPPn-00059w-69 for submit@debbugs.gnu.org; Mon, 14 Jul 2025 16:04:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubPPU-00054g-W6 for bug-gnu-emacs@gnu.org; Mon, 14 Jul 2025 16:04:28 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ubPPS-0005Yr-HR for bug-gnu-emacs@gnu.org; Mon, 14 Jul 2025 16:04:24 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-ae0dffaa8b2so938309466b.0 for ; Mon, 14 Jul 2025 13:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752523460; x=1753128260; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=04i79BPkaianxj93hAns8CgL7D86eF5p0bpDIFQt0g0=; b=FiC6x79IcibW/eOLY7E1OpVyj1MK6GSTUaf87izlVdGXGWd0KWWu/u+/qX8vZaVWAc 2VDODflBKqrs2ikclX1QMKTzTxAH2bMm16GPv08gCRpf6MSfT9rAp5rB4avWj018JvIW AlAq0WTOvF90ceNy8A37ABdBzAqgwAhG/Him8WlSEDMISek0O1hXCyHIBr5t1Lk0sVVv Hqzy5tYIKrNwNgF5I3b42UYoS0ASKFHKT30VeDUFwT74LvrO3dDgRHehtjIb4EnzitaQ dUvc47KNsawIWIQw4FX5VC5C+1diQZsPeLzpFPCeqMdOSFfYlENg8+O6Heb6kWMU6kJn P/lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752523460; x=1753128260; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=04i79BPkaianxj93hAns8CgL7D86eF5p0bpDIFQt0g0=; b=eYvpDDxDjWh1StKm48MSAkGzRpseCMqAt8M9sWjBkhhsgL3XRcgUaAXzfPgYZoOojP 4b0v6Ed92Nm17HFnwSWu4cjJBsWARgpytPai1TQzZEYH9Mg+TESvLRzTfEJllj8VQgJO f4mhW40jt78WxOD0Yizh7kSH+pLeMOPlAza83ojgiOzeg5tnXCqV71FiSWElK4Y2vBpa KTULmR1S06IrEin+QQ5Zy8aTOyyP5pc2gN88NLjkGwKCwrbC9qelJxvQh8WzLflmTm9K mkc3HbyxKHKQa4YvHDIJvDSL/VLBoWnsYp/xlYr/oDZEz6wRqCEHmGK5Ril4z1jCm70r Zz3g== X-Gm-Message-State: AOJu0YyaB69lnxaP/bm8HWeC2yv94TpbtmH+6LNS0OcM5GIIgnwGW3KD +x+6boVJiJRcl81+9/dT0E0KNua72H7oBUN7RzJDCOaAVqsdYWDQoMCV3rXlZA== X-Gm-Gg: ASbGnctprJfzFZsDqQvxGdh9W7DGXTMAQcb+WNONeoC9lkYV58mef757hod2wWh1QLj kky7W1bwLaOWmJscD//05SyuejNZkbTpUeHHTntQIZ4O31eVjEK/ZDo4DpL9DYEbqr8KAv+tgid ab+fkUv3o4YPC5L44ISX3yUGxarFUiVf0zY9FHjnpD7Zs5250SoLFuCcuNjX0yxc3JmAvgOTmzQ q5t9RZih7ZiFRwPAifCpO4NIbrYNn3hJF2xhjtGN+Zm5iw3hYGc7wesP7asNsvSwz2KeYvh3imz CYoZ6H8HR5+30+TjGC2/ZYFGuCsEshqGF83Qqf4GFyuHpw6cLK/UpPhZvd5PyaWF/9Lx7Yl18ZM Utx/f29BWs2vx7g1AjpQ= X-Google-Smtp-Source: AGHT+IFUlc/wrc0iMmtIRlEJbIs5+ZYNpwx9h9Y2r82RiRbSb7BDjMD5xpx6hXjFDnaFzovof6NHNw== X-Received: by 2002:a17:907:2daa:b0:add:f2c8:7d3f with SMTP id a640c23a62f3a-ae6fbf2395emr1330562166b.33.1752523459976; Mon, 14 Jul 2025 13:04:19 -0700 (PDT) Received: from caladan ([31.177.115.39]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ae6e7edd6cfsm876344666b.38.2025.07.14.13.04.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 13:04:19 -0700 (PDT) From: Helmut Eller To: bug-gnu-emacs@gnu.org Subject: 31.0.50; Unnecessary GC in after-load-functions X-Debbugs-Cc: Date: Mon, 14 Jul 2025 22:04:18 +0200 Message-ID: <878qkqfsjh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x62a.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) 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: -0.0 (/) In loadup.el there is this: (add-hook 'after-load-functions (lambda (_) (garbage-collect))) What's this for? It seems unnecessary. It would be nice to remove this, because without it the time to execute loadup.el goes down from 13 seconds to 6. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 14 22:30:58 2025 Received: (at 79021) by debbugs.gnu.org; 15 Jul 2025 02:30:58 +0000 Received: from localhost ([127.0.0.1]:38506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ubVRZ-0003Sb-UC for submit@debbugs.gnu.org; Mon, 14 Jul 2025 22:30:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52360) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ubVRR-0003Rb-Qy for 79021@debbugs.gnu.org; Mon, 14 Jul 2025 22:30:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubVRL-0005CQ-4y; Mon, 14 Jul 2025 22:30:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xiM8MpUy5YsU5ge4RPkE7OZaE1wl9EERidxnIUxKT3o=; b=puSHc9MIll4m 2pIA3VlvRjJQrgS8N/XVkAJ7uwEU8FSdViq87PXJPfa136mZkbDbhHvQ5R4cH9ygfa9IlT/9kQr8Q moF1FiyzNSI57QTqM7Elw2gC75XCvgLPzFWNUcBcZrfZmPcY0eeTNRcSJeSQbUP29SUpvJw4LSsyN Tp2v0yo/aeEk4mCFhvQB1bhjQw/ioXiTilNmlqziJhCIEhNz8KsGaggunstLYPvpKyJj69Fk8phGQ a+DE4xNN6bO0zhXJ53fTrQU4X0fVs3bcv0YQWNvhmY1sSsPF9E+c7zT69Us1mX+H02LwchIl/6rZV QP0sewgCdUr7mCTp+9sapg==; Date: Tue, 15 Jul 2025 05:30:40 +0300 Message-Id: <86ecuib2y7.fsf@gnu.org> From: Eli Zaretskii To: Helmut Eller , Stefan Monnier In-Reply-To: <878qkqfsjh.fsf@gmail.com> (message from Helmut Eller on Mon, 14 Jul 2025 22:04:18 +0200) Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions References: <878qkqfsjh.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@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 (---) > From: Helmut Eller > Date: Mon, 14 Jul 2025 22:04:18 +0200 > > In loadup.el there is this: > > (add-hook 'after-load-functions (lambda (_) (garbage-collect))) > > What's this for? It seems unnecessary. > > It would be nice to remove this, because without it the time to execute > loadup.el goes down from 13 seconds to 6. I presume this is because we don't want to dump any garbage. Stefan? From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 15 09:59:51 2025 Received: (at 79021) by debbugs.gnu.org; 15 Jul 2025 13:59:51 +0000 Received: from localhost ([127.0.0.1]:42699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ubgCF-0003H4-8T for submit@debbugs.gnu.org; Tue, 15 Jul 2025 09:59:51 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47133) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ubgCA-0003Ga-SA for 79021@debbugs.gnu.org; Tue, 15 Jul 2025 09:59:47 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3341C806C1; Tue, 15 Jul 2025 09:59:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1752587979; bh=RTeXtmzq4BB9MTJa4RES5HlN2S5VPdKrK+9JDYZp1Yg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=H1NnkLgO/ggGauAsUfZKYhbhBGCNhE5CAMWZN4b6FiwKLJP3X4m2wcQrOKb1nKzS+ sTgFSlpMQLTrABcNqHdUgyyBdzMRaPMP0r79DWk+9phWuBW20BKnJbephMYx4/SHgp GUQpMFV1l7UfO5FCBmft2xxVgKTwT/LCzH22vYZ8tW4gol85E4NnSu8KoYxoT9+Uad MvSmPkCSTET2V0nnoZd1JoMK8+liGGOl1rUm2V9+s8HmQtcUYgmmPWcm/NXvw2zTba PdRaKcFJ1R2VJP607/Q98pR+Gd16WoYFuAzoYGIUDsUL6TIpclb6TLKeC5cvaM0WOg xo6vWTtQS133g== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3E88C80916; Tue, 15 Jul 2025 09:59:39 -0400 (EDT) Received: from pastel (unknown [104.247.225.139]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 10B181202F2; Tue, 15 Jul 2025 09:59:39 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions In-Reply-To: <86ecuib2y7.fsf@gnu.org> Message-ID: References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> Date: Tue, 15 Jul 2025 09:59:38 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.278 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@debbugs.gnu.org, Helmut Eller 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 (---) >> In loadup.el there is this: >> >> (add-hook 'after-load-functions (lambda (_) (garbage-collect))) >> >> What's this for? It seems unnecessary. >> >> It would be nice to remove this, because without it the time to execute >> loadup.el goes down from 13 seconds to 6. > > I presume this is because we don't want to dump any garbage. > Stefan? AFAIK it was added to keep the dumped Emacs' heap "dense": if we run the GC only "in the normal way", the heap objects created during `loadup.el` end up interspersed with more free spaces. It's possible/likely that the portable dumper has made that unnecessary. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 03:26:14 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 07:26:14 +0000 Received: from localhost ([127.0.0.1]:47960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uwyAf-0003wP-Pm for submit@debbugs.gnu.org; Fri, 12 Sep 2025 03:26:14 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:60622) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uwyAc-0003vY-J7 for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 03:26:11 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45dfb8e986aso16248785e9.0 for <79021@debbugs.gnu.org>; Fri, 12 Sep 2025 00:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757661964; x=1758266764; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=8F9pilrLJzwYATY0G5M0Mp6lSKFV/oJnUyIwX8Th9/g=; b=RXxOCkOoHs56uWJo2h1CxyAYLNQbm2DYcpbFXFgG5Cf4FKBfxHqSn9QorRCBNmTp/r x5MK+Ac/HXS6WR0bKNGRd3rp77i945QytfbmsCdhLzb7ueZTs8qzdAbxXGNUZj6QafJw yTWriSW339nWI2O8NpieAvpuE5BDZvuAzWmoJH/fbPgsJTkmFU46EkhrVeTy2e3Lh4fM y2WATJfyxu3AuRCK01WDTL2vs4OG3PXjrLu6WgXZy2uFH8/3eWbqj402iUdeSZ/FqbSt WHjzIJcDPjWot+GTKpU3zTNb0U9FmQEAQJe+VHkbvzubJ+sgwILfr4V4/7o7Grndi7zz 9Mhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757661964; x=1758266764; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8F9pilrLJzwYATY0G5M0Mp6lSKFV/oJnUyIwX8Th9/g=; b=F8X7sSjIkvfCz9G2jCltMFmoPrn8cnYi9acjvUAlmPg2pi2YuDq5ge7rbxBJzMUQ4y d7zMiy5RtlkwwH4TwMK/4+GWMnFqvUDcVqsL3rtYt9+Jcvc0P5uD3wkGrfbjGgdSuMVs aEI4rgH/NZS11skvn83lfE0VA45RuhREQlOA28xFLqu5DyGkN0vEoPV7/wB1jEvuLEee B2GyLgsOcBMX5b7QX+T3WZGUcVzDTFJnnEBrHsRdKHQHuQH0Z9u7ULC92OrfeaT/wg/e MB5kKupkRHrqXPWbeQqM4IfsKarJzYOZHgeoc5rgUdU2z+bXH5+eKoeNp4HRFItH3IUi fLjA== X-Forwarded-Encrypted: i=1; AJvYcCVWbTNkm/2YjxIR6eFdsOvyKO9PvDNB+h2gdpD97CeXuv5XTqT1Srsx5x72dw1cv44c7setJQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yyem7Ts8AScIOjqyILWbBDG5B8qK+riv8nt787A2FTqI2k3WPv0 X+liIRODtWGhlrq4rC/5Leql9N2wAP/md2uoedCsjNBDt45rEWkSskjt/n3LyQ== X-Gm-Gg: ASbGncshDGfPUxPV2A6b2Mto/kjGdP6IUaTS7uVNMRgZ0/Su6Rv2cl2GPLRur/YMl/1 fb6lT54GOtIAPij8b4k4u9S67M0y2yj3WU8Ew/eGLubEIHmmdcle5Rkn57iS2Olft6yfINOtWQv O27hvQdgvlyu0WfahaWbOU+0DIe9rFsRaCu/0cdn6JxhIojyU3fY+rX0XScCOXuTxOMzPT6pKLA puY5EinyihoUV2q+l2+C+lGfL/5OknTlqcgdftoPGz/0x9AmGiGlX6zdzuG/PQDKLs6R0GBYR7n 1EX1yncGiFLQhWLFZKdXEsTnKWzUfY/T6K++6rYnxXf18xb7/hUgHzBOzwLvC7CviEuMYxXUX4X hC9NE8Sg/Jtf3pcERUm9WDBTE+Qr9NSsQAE/Y7MajOQ== X-Google-Smtp-Source: AGHT+IFRewPT5G+SDmriVSeRSkaeQImx9Z7+ETeQHALktWzLmQlIRJy2ubJpPvxopNDNrZpdINNFtg== X-Received: by 2002:a05:600c:1d2a:b0:45b:9c93:d21d with SMTP id 5b1f17b1804b1-45f24ef20d0mr1526405e9.8.1757661963783; Fri, 12 Sep 2025 00:26:03 -0700 (PDT) Received: from caladan ([31.177.112.212]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e760776bb8sm5646833f8f.3.2025.09.12.00.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Sep 2025 00:26:03 -0700 (PDT) From: Helmut Eller To: Stefan Monnier Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions In-Reply-To: References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> Date: Fri, 12 Sep 2025 09:26:02 +0200 Message-ID: <87a5302ktx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79021 Cc: Eli Zaretskii , 79021@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 (-) --=-=-= Content-Type: text/plain On Tue, Jul 15 2025, Stefan Monnier wrote: >>> In loadup.el there is this: >>> >>> (add-hook 'after-load-functions (lambda (_) (garbage-collect))) >>> >>> What's this for? It seems unnecessary. >>> >>> It would be nice to remove this, because without it the time to execute >>> loadup.el goes down from 13 seconds to 6. >> >> I presume this is because we don't want to dump any garbage. >> Stefan? > > AFAIK it was added to keep the dumped Emacs' heap "dense": if we run the > GC only "in the normal way", the heap objects created during `loadup.el` > end up interspersed with more free spaces. > > It's possible/likely that the portable dumper has made that unnecessary. Should I commit this? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=loadup.patch diff --git a/lisp/loadup.el b/lisp/loadup.el index 18f09878f98..05bd468b713 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -127,7 +127,11 @@ ;; Do it after subr, since both after-load-functions and add-hook are ;; implemented in subr.el. -(add-hook 'after-load-functions (lambda (_) (garbage-collect))) +;; +;; This was probably done to reduce fragmentation with unexec. With the +;; pdumper it makes little sense. See bug#79021. +(if (not (fboundp 'dump-emacs-portable)) + (add-hook 'after-load-functions (lambda (_) (garbage-collect)))) (load "version") --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 03:55:10 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 07:55:10 +0000 Received: from localhost ([127.0.0.1]:48133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uwycf-00065E-Iv for submit@debbugs.gnu.org; Fri, 12 Sep 2025 03:55:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51618) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uwycb-0005zp-9s for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 03:55:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uwycT-0006DB-AW; Fri, 12 Sep 2025 03:54:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=D8UzcKF9mw3TylNjHh0lID7Z/6MFAi0eVBhXZrFzJJo=; b=VMZFoQ4q/rvE /ly10d76idnbiFefN6nzVXPLvuu4Tb8XzBycGachANYkY8LWtZdQSrEptLkkOMie0FznLemXOaKhJ /vxnVgKghedr+64XXojWqmkVFjyC8rziLifNtHwLv4PS52GAGkp1f00jQhyEcAczlNhHYvsKPoTKR eEqRvQWtpmIKD45ZW1wGbJOMBjzkg4KX1VHpNMyLpDnkHRHfc+YmbbNbswt0U2aLIQJFHDECWAM+D JN9yxbJ6HvGqeu7+QCdePeHIJFGrpzLMglJ4efPTpvLCtdcWhJ0x3APcMb5URdi7wgMCBUS9qVLZK joA36fQjVN9vAqWVorUvxg==; Date: Fri, 12 Sep 2025 10:54:42 +0300 Message-Id: <86ms70t8al.fsf@gnu.org> From: Eli Zaretskii To: Helmut Eller , Daniel Colascione In-Reply-To: <87a5302ktx.fsf@gmail.com> (message from Helmut Eller on Fri, 12 Sep 2025 09:26:02 +0200) Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@debbugs.gnu.org, monnier@iro.umontreal.ca 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 (---) > From: Helmut Eller > Cc: Eli Zaretskii , 79021@debbugs.gnu.org > Date: Fri, 12 Sep 2025 09:26:02 +0200 > > On Tue, Jul 15 2025, Stefan Monnier wrote: > > >>> In loadup.el there is this: > >>> > >>> (add-hook 'after-load-functions (lambda (_) (garbage-collect))) > >>> > >>> What's this for? It seems unnecessary. > >>> > >>> It would be nice to remove this, because without it the time to execute > >>> loadup.el goes down from 13 seconds to 6. > >> > >> I presume this is because we don't want to dump any garbage. > >> Stefan? > > > > AFAIK it was added to keep the dumped Emacs' heap "dense": if we run the > > GC only "in the normal way", the heap objects created during `loadup.el` > > end up interspersed with more free spaces. > > > > It's possible/likely that the portable dumper has made that unnecessary. > > diff --git a/lisp/loadup.el b/lisp/loadup.el > index 18f09878f98..05bd468b713 100644 > --- a/lisp/loadup.el > +++ b/lisp/loadup.el > @@ -127,7 +127,11 @@ > > ;; Do it after subr, since both after-load-functions and add-hook are > ;; implemented in subr.el. > -(add-hook 'after-load-functions (lambda (_) (garbage-collect))) > +;; > +;; This was probably done to reduce fragmentation with unexec. With the > +;; pdumper it makes little sense. See bug#79021. > +(if (not (fboundp 'dump-emacs-portable)) > + (add-hook 'after-load-functions (lambda (_) (garbage-collect)))) Are we sure the problem no longer happens with pdumper? Daniel, WDYT? In any case, the fboundp test is not enough, we should test the value of dump-mode instead, I think. Because Emacs might be built with pdumper support, but this session is not going to call dump-emacs-portable, due to command-line options or some other trick. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 04:02:07 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 08:02:07 +0000 Received: from localhost ([127.0.0.1]:48176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uwyjO-0006gw-W7 for submit@debbugs.gnu.org; Fri, 12 Sep 2025 04:02:07 -0400 Received: from dancol.org ([2600:3c01:e000:3d8::1]:40234) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uwyjM-0006gg-Ap for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 04:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rMk6/CuhX4FzAJFsv9otvwv0Fi/F+WKwvWenasjtXRU=; b=ltcvK2iX4p9yXawW7WVBZmSLKz i5NbBFYRNMAMPIwKPS+vxBhB0pzMjDFkQ1RPT0r/sSyYtWg7EPnF/hw7OjtDXSk2k6xO05dEvfVhr 3FVsqd0IBiTXFcOak7xuytrgVFMMwmu0iftsG+8ggd5RFgjdnHlP9R6E7MmpcqKr3jZQMJzEcub2C 3B8uPooyCSxfZKIdUtPJNZ+yCOFFNLjTugyhkwzRTTbPoaZH6oXcYruIf9T0N8iTAAr1kVA1FWPqh fJttl2K3ME4EBNAhygE4chPTJjNWTlyEfwL20GWd7SvCRzVXVSuD65uZ4w5dGy4QHQ34ai6xaxPiC akeUDlqQ==; Received: from [2600:1010:b014:10a5:0:48:9081:2401] (port=45972 helo=ehlo.thunderbird.net) by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uwygo-001P5F-19; Fri, 12 Sep 2025 03:59:26 -0400 Date: Fri, 12 Sep 2025 01:01:52 -0700 From: Daniel Colascione To: Eli Zaretskii , Helmut Eller Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions User-Agent: K-9 Mail for Android In-Reply-To: <86ms70t8al.fsf@gnu.org> References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> <86ms70t8al.fsf@gnu.org> Message-ID: <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> 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: 79021 Cc: 79021@debbugs.gnu.org, monnier@iro.umontreal.ca 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 (-) On September 12, 2025 12:54:42 AM PDT, Eli Zaretskii wrote= : >> From: Helmut Eller >> Cc: Eli Zaretskii , 79021@debbugs=2Egnu=2Eorg >> Date: Fri, 12 Sep 2025 09:26:02 +0200 >>=20 >> On Tue, Jul 15 2025, Stefan Monnier wrote: >>=20 >> >>> In loadup=2Eel there is this: >> >>>=20 >> >>> (add-hook 'after-load-functions (lambda (_) (garbage-collect))) >> >>>=20 >> >>> What's this for? It seems unnecessary=2E >> >>>=20 >> >>> It would be nice to remove this, because without it the time to exe= cute >> >>> loadup=2Eel goes down from 13 seconds to 6=2E >> >> >> >> I presume this is because we don't want to dump any garbage=2E >> >> Stefan? >> > >> > AFAIK it was added to keep the dumped Emacs' heap "dense": if we run = the >> > GC only "in the normal way", the heap objects created during `loadup= =2Eel` >> > end up interspersed with more free spaces=2E >> > >> > It's possible/likely that the portable dumper has made that unnecessa= ry=2E >>=20 >> diff --git a/lisp/loadup=2Eel b/lisp/loadup=2Eel >> index 18f09878f98=2E=2E05bd468b713 100644 >> --- a/lisp/loadup=2Eel >> +++ b/lisp/loadup=2Eel >> @@ -127,7 +127,11 @@ >> =20 >> ;; Do it after subr, since both after-load-functions and add-hook are >> ;; implemented in subr=2Eel=2E >> -(add-hook 'after-load-functions (lambda (_) (garbage-collect))) >> +;; >> +;; This was probably done to reduce fragmentation with unexec=2E With= the >> +;; pdumper it makes little sense=2E See bug#79021=2E >> +(if (not (fboundp 'dump-emacs-portable)) >> + (add-hook 'after-load-functions (lambda (_) (garbage-collect)))) > >Are we sure the problem no longer happens with pdumper? Daniel, WDYT? > It's unnecessary with pdumper, which compacts automatically=2E >In any case, the fboundp test is not enough, we should test the value >of dump-mode instead, I think=2E Because Emacs might be built with >pdumper support, but this session is not going to call >dump-emacs-portable, due to command-line options or some other trick=2E Just delete it=2E From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 06:39:57 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 10:39:57 +0000 Received: from localhost ([127.0.0.1]:48970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ux1C8-0001HA-Ih for submit@debbugs.gnu.org; Fri, 12 Sep 2025 06:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38578) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ux1C1-0001G6-3J for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 06:39:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ux1Bv-0007Un-F0; Fri, 12 Sep 2025 06:39:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KIA6gH7Kflzme+vq0mhEbSoVSnvo0C4/VdxDIGzRYTY=; b=Aouy6Vd/rZXU oJgcmEmmGGuIKzb6NehniYoCljb7WYCVh8NolrNgCavf2muxCIC47cY2YRcv7FlHCNHfSrBI1B2sI yGeIe3eaBMD15NgsgiK997hzBL89JRC0f0hwYGVcatgCAE889Nq+vz/aybvPdU0O3v9DCdjVNvVJ0 OQpI+LsRE1EEYugz4Uy5MZ+XSP3Wr9prDDWlfuCTkBVKgQqHAlxGpdwSO9ykkTrCs3DfSsd13GXrw ymtuIq0wlXto597AZnkWPNqd5dKtm7Hr7YTvGDdReCdHJZadXvpyD/Qpqvg1/KQ9qgOES/ItmAVp5 7Jb40jAsGs5N1/RonFAhgA==; Date: Fri, 12 Sep 2025 13:39:39 +0300 Message-Id: <86ikhot0no.fsf@gnu.org> From: Eli Zaretskii To: Daniel Colascione In-Reply-To: <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> (message from Daniel Colascione on Fri, 12 Sep 2025 01:01:52 -0700) Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> <86ms70t8al.fsf@gnu.org> <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@debbugs.gnu.org, eller.helmut@gmail.com, monnier@iro.umontreal.ca 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 (---) > Date: Fri, 12 Sep 2025 01:01:52 -0700 > From: Daniel Colascione > CC: monnier@iro.umontreal.ca, 79021@debbugs.gnu.org > > >> -(add-hook 'after-load-functions (lambda (_) (garbage-collect))) > >> +;; > >> +;; This was probably done to reduce fragmentation with unexec. With the > >> +;; pdumper it makes little sense. See bug#79021. > >> +(if (not (fboundp 'dump-emacs-portable)) > >> + (add-hook 'after-load-functions (lambda (_) (garbage-collect)))) > > > >Are we sure the problem no longer happens with pdumper? Daniel, WDYT? > > > > It's unnecessary with pdumper, which compacts automatically. Thanks. > >In any case, the fboundp test is not enough, we should test the value > >of dump-mode instead, I think. Because Emacs might be built with > >pdumper support, but this session is not going to call > >dump-emacs-portable, due to command-line options or some other trick. > > Just delete it. It's still useful if starting undumped Emacs, no? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 07:00:47 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 11:00:48 +0000 Received: from localhost ([127.0.0.1]:49037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ux1WJ-0002fR-GF for submit@debbugs.gnu.org; Fri, 12 Sep 2025 07:00:47 -0400 Received: from dancol.org ([2600:3c01:e000:3d8::1]:49018) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ux1WG-0002fG-QP for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 07:00:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: References:In-Reply-To:Subject:CC:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FyrqEd9SenSIv2PR8HYejMSTEgPVUbFLNRSeerTsks8=; b=QE4r5CIGQbAI2ea6fsBfXRrc3/ CxJrTq8eXSuJfjpso+qw9KKg3iPXpZLIG/atm+JPTdgYyPwctg7HLOSxncWAHdh29UjS/9za4VVy+ EMvbigQ11XcUSTv+wZY361l+T1PT2ub9pG31YdsNvgPF3Sm71g/tWzAl9nXyiPyth/X0ILrl1M+fa FtzcDhJDIOOxo3zRkJx3DC/+TrJk99+hpyqiXJiungujbeH0QddgSs8JLKQCqQsMHlnt8CbuJk4zJ IhmDAHrdRLXzWIsWeC1Sm4OiKIaLI1rUpMPmYpmnKk9Zt3oHeBdTomogV3pqI+KDnzWdRepJHLTau Uwm558Pg==; Received: from [2600:1010:b014:10a5:0:48:9081:2401] (port=36496 helo=ehlo.thunderbird.net) by dancol.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ux1Tk-001Pi7-2p; Fri, 12 Sep 2025 06:58:08 -0400 Date: Fri, 12 Sep 2025 04:00:35 -0700 From: Daniel Colascione To: Eli Zaretskii Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions User-Agent: K-9 Mail for Android In-Reply-To: <86ikhot0no.fsf@gnu.org> References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> <86ms70t8al.fsf@gnu.org> <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> <86ikhot0no.fsf@gnu.org> Message-ID: 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: 79021 Cc: 79021@debbugs.gnu.org, eller.helmut@gmail.com, monnier@iro.umontreal.ca 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 (-) On September 12, 2025 3:39:39 AM PDT, Eli Zaretskii wrote: >> Date: Fri, 12 Sep 2025 01:01:52 -0700 >> From: Daniel Colascione >> CC: monnier@iro=2Eumontreal=2Eca, 79021@debbugs=2Egnu=2Eorg >>=20 >> >> -(add-hook 'after-load-functions (lambda (_) (garbage-collect))) >> >> +;; >> >> +;; This was probably done to reduce fragmentation with unexec=2E W= ith the >> >> +;; pdumper it makes little sense=2E See bug#79021=2E >> >> +(if (not (fboundp 'dump-emacs-portable)) >> >> + (add-hook 'after-load-functions (lambda (_) (garbage-collect)))= ) >> > >> >Are we sure the problem no longer happens with pdumper? Daniel, WDYT? >> > >>=20 >> It's unnecessary with pdumper, which compacts automatically=2E > >Thanks=2E > >> >In any case, the fboundp test is not enough, we should test the value >> >of dump-mode instead, I think=2E Because Emacs might be built with >> >pdumper support, but this session is not going to call >> >dump-emacs-portable, due to command-line options or some other trick= =2E >>=20 >> Just delete it=2E > >It's still useful if starting undumped Emacs, no? I don't think so=2E It wouldn't be any more useful than it would be in reg= ular Emacs: GC doesn't differ between a dumped and an undumped Emacs, meani= ng the code above would be good in both or neither=2E Since we don't have a= theory of why it would be useful in any circumstance post-unexec and have = data showing it's a pessimization, let's just delete it and take the comple= xity reduction win=2E From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 08:35:55 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 12:35:55 +0000 Received: from localhost ([127.0.0.1]:49364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ux30M-0003Ok-MQ for submit@debbugs.gnu.org; Fri, 12 Sep 2025 08:35:55 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64552) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ux30D-0003OI-Cy for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 08:35:50 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4945B44097B; Fri, 12 Sep 2025 08:35:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757680537; bh=nOfRyCjmdHhbfgTbg1sk82ul0h+txGo5Om+Cy6d1N+4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EexhKMm1NNA0mhUCSjsWwjkKLQCG39bqaFJeTpDJcvH6C3MLAEaFTzhYQDUkPHVZO c7ydMgqLJDkuYMSUqAYzGDhonij95ZIgyp1ZLsvDsHpfBdAAi/jreFy4ionhyoYSxB DEJusjyLub304PgejubWOHo8yk730viZaOLJ1uqV60l64wqdYDRbjwQIcncV/96h7M O4xJ4ko4lZN43av/4HAR7CybAw411qCg3UJHIrXQA+hw1+02jAckkoeZnokoeFM9NC i8DZSbqSzVCCSpjdUeX3XPaIbOHM1luwZjbR0VTNFlSiukdV7c+82nR2WaQG83Bczg 5nFW5fdHz9niQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 42533440602; Fri, 12 Sep 2025 08:35:37 -0400 (EDT) Received: from alfajor (unknown [104.247.225.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 08EAB120184; Fri, 12 Sep 2025 08:35:37 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions In-Reply-To: <86ikhot0no.fsf@gnu.org> Message-ID: References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> <86ms70t8al.fsf@gnu.org> <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> <86ikhot0no.fsf@gnu.org> Date: Fri, 12 Sep 2025 08:35:36 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@debbugs.gnu.org, Daniel Colascione , eller.helmut@gmail.com 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 (---) >> >In any case, the fboundp test is not enough, we should test the value >> >of dump-mode instead, I think. Because Emacs might be built with >> >pdumper support, but this session is not going to call >> >dump-emacs-portable, due to command-line options or some other trick. >> Just delete it. > It's still useful if starting undumped Emacs, no? Not really: its use was beneficial to try and keep the unexec'd `emacs` compact, but it came at the cost of a slowdown. The tradeoff was positive then because we cared more about the size of the `emacs` binary then about the slight increase to the build time. But when starting Emacs un-dumped the benefit is mostly lost because in that case we care more about minimizing the startup time than about minimizing the size of the heap. Helmut's patch looks good to me (you can remove the "probably" from the comment, tho). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 08:48:24 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 12:48:24 +0000 Received: from localhost ([127.0.0.1]:49385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ux3CS-0003yY-E0 for submit@debbugs.gnu.org; Fri, 12 Sep 2025 08:48:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49482) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ux3CO-0003y9-6P for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 08:48:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ux3CD-00043D-GI; Fri, 12 Sep 2025 08:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1W+1sJBigUNbz7kWwH2eo80NfK60JXCVS+LCrstSFlo=; b=SBWTkHBKv8qT D4dC+VXfDNG01G17pCbNyGtEsqEKmHn6DWwj3xtNm5rzGZrDypV7KEMBkn45vB05Cmc6ZIXduzcbL OSP0fpYFxYyR0t0qPubIWQ4Mx61sigVasi0NE1Tx85VKaZpNNs1z8EJYB5kcKrO3x5SW9hq2FesMq IKzvhET2I3P4CDchv0/Nr4c5GXjWo5jPm3CmXN2efTZDAaKEkuIWkg9uheclmKG1WCgZj+DJxATvy b1XfpXTVupJSnqK8L1+8/oQ5lEnKae1EvTm7uzn7B4JEpkp0H3iMAr1DYyAismpEnHLReojHtwabC u5FREZ2lyufOdU/tQvdgqw==; Date: Fri, 12 Sep 2025 15:48:05 +0300 Message-Id: <86bjnfu9a2.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Fri, 12 Sep 2025 08:35:36 -0400) Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> <86ms70t8al.fsf@gnu.org> <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> <86ikhot0no.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@debbugs.gnu.org, dancol@dancol.org, eller.helmut@gmail.com 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 (---) > From: Stefan Monnier > Cc: Daniel Colascione , eller.helmut@gmail.com, > 79021@debbugs.gnu.org > Date: Fri, 12 Sep 2025 08:35:36 -0400 > > >> >In any case, the fboundp test is not enough, we should test the value > >> >of dump-mode instead, I think. Because Emacs might be built with > >> >pdumper support, but this session is not going to call > >> >dump-emacs-portable, due to command-line options or some other trick. > >> Just delete it. > > It's still useful if starting undumped Emacs, no? > > Not really: its use was beneficial to try and keep the unexec'd `emacs` > compact, but it came at the cost of a slowdown. The tradeoff was > positive then because we cared more about the size of the `emacs` binary > then about the slight increase to the build time. > > But when starting Emacs un-dumped the benefit is mostly lost because in > that case we care more about minimizing the startup time than about > minimizing the size of the heap. But in that case, why do we need the fbound test at all? The unexec option is gone, so what other Emacs configuration will that test cater to? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 08:50:02 2025 Received: (at 79021) by debbugs.gnu.org; 12 Sep 2025 12:50:03 +0000 Received: from localhost ([127.0.0.1]:49395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ux3E2-00043l-93 for submit@debbugs.gnu.org; Fri, 12 Sep 2025 08:50:02 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27211) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ux3Dy-00042w-RZ for 79021@debbugs.gnu.org; Fri, 12 Sep 2025 08:49:59 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3409B4409AF; Fri, 12 Sep 2025 08:49:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757681392; bh=MPH73119DBKi3K6blxytax5zN1i62Ty85MOtt1gg4nU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=e8Jnhc/hdOOhD5r4ABhw0teJIAIVE6xKS32GGoMn8ne3zFXOtoFlqWwiA7M+M+Hua Uyk35Bk3SjStgsop4Wl6Vdb8wBLyeL30G8mFcQhtPI+zO0eAEUP6SZZUCiMTpaWXhx r0XDKicQpoVob3mc0KDkgDChotgE0+lw7KMBPZ5tUg5Yve7tae73sr5SU3mgYziI0j GeAFmU6ZT4rbkDM7rzRY3irfZAdhx0rD5ldGXKPwS/SfvFkvbed9nho25ImVm3S82U 6SXF8Stqv7S/Sh65HoKTNlylr5f+IiuViGEubGe4GLJNZm8cTwHSMzDzIkf+2SBS3w 5XMS5nJwQmIug== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5069B44095C; Fri, 12 Sep 2025 08:49:52 -0400 (EDT) Received: from alfajor (unknown [104.247.225.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 152761206B4; Fri, 12 Sep 2025 08:49:52 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions In-Reply-To: <86bjnfu9a2.fsf@gnu.org> Message-ID: References: <878qkqfsjh.fsf@gmail.com> <86ecuib2y7.fsf@gnu.org> <87a5302ktx.fsf@gmail.com> <86ms70t8al.fsf@gnu.org> <7F8A8E16-9F97-435D-99E5-97AD337465FD@dancol.org> <86ikhot0no.fsf@gnu.org> <86bjnfu9a2.fsf@gnu.org> Date: Fri, 12 Sep 2025 08:49:50 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79021 Cc: 79021@debbugs.gnu.org, dancol@dancol.org, eller.helmut@gmail.com 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 (---) > But in that case, why do we need the fbound test at all? The unexec > option is gone, Ah, right, forgot that we removed it. Then we should just remove that `add-hook`. Stefan