From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mickey Petersen Newsgroups: gmane.emacs.bugs Subject: bug#70108: 29.1.90; `defalias' and `current-load-list' Date: Mon, 01 Apr 2024 16:34:08 +0100 Organization: Mastering Emacs Message-ID: <87cyr9ayb6.fsf@masteringemacs.org> References: <87h6gmbek2.fsf@masteringemacs.org> <8634s6be0x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37186"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e @VERSION@; emacs 29.1.90 Cc: 70108@debbugs.gnu.org, Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 01 17:39:15 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rrJkg-0009Ns-5G for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Apr 2024 17:39:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrJkS-0004IJ-EG; Mon, 01 Apr 2024 11:39:00 -0400 Original-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 1rrJkQ-0004I7-Sc for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 11:38:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrJkQ-0005Jr-JE for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 11:38:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrJkT-0004G1-OI for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 11:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Apr 2024 15:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70108 X-GNU-PR-Package: emacs Original-Received: via spool by 70108-submit@debbugs.gnu.org id=B70108.171198588616295 (code B ref 70108); Mon, 01 Apr 2024 15:39:01 +0000 Original-Received: (at 70108) by debbugs.gnu.org; 1 Apr 2024 15:38:06 +0000 Original-Received: from localhost ([127.0.0.1]:51413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrJja-0004Ek-4h for submit@debbugs.gnu.org; Mon, 01 Apr 2024 11:38:06 -0400 Original-Received: from mail-uksouthazon11021010.outbound.protection.outlook.com ([52.101.196.10]:46466 helo=LO3P265CU004.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrJjX-0004De-8U for 70108@debbugs.gnu.org; Mon, 01 Apr 2024 11:38:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WCHA4CiAZF2QeDGclIYaZEt9aHlfq+Npyoc36wPW6JvIJG0saQfVGSq/FzeLTZR41PrCDE1FA/oRXsrAwNGfGk/Izmx3wc0100XIwkIgT6ezo1i1tEal1J4FfG1XQynIsmLDZ6S7+O/xLlHcPl5Omx5lO9oCJp/Vur7gM9SxPVtGK3CuhReLZJJgwxVMuORDOIszggCyUI8bQwx5yOrQPtzAqf0I6zE4pLZN6r3yhqJrJTNKrAaJNM959Uet7bWerwXxpVDVHxmzsKkqaL/vrgsTTzKzsaiSgBhff1Y1asarvZXA+paNtB1NresEblQDP8O1stCEhjLywuSybZMAxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vthTw6sY13KqopZR6pfsff7+4A/35kuZKeiHWocGT+Y=; b=f2C5HB8R2jg0ytlKmyk31vxGjOwQ609nExOaXSANYoL+5//ttkdpeMtm4XIK7o1mrHRAkMXmqfqhXRi6LJU0SQyodfMytc15T5BDBfL9htguIjzi10dPddSPDZiVlCYSr3Rv54E4oTt56rPxVZdwOv4HQbrvPrDf8uRxOX3mNxyOKnD6dUbXkyt673XE81HC1ravzOmkeQ2YohGkz20nZtLI6AgtCR8IBDXzya6DzRnZAYKp0xrV+RkD1N31rum/XnChi0Vo4uhyG5rNLA5HaxGXlqMAQHiXnHc+xRLWKD9mjvYrccETWb4w/tIy+fRxZe67U62My9CbE3uVcUcoYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 178.79.136.144) smtp.rcpttodomain=debbugs.gnu.org smtp.mailfrom=masteringemacs.org; dmarc=pass (p=none sp=none pct=100) action=none header.from=masteringemacs.org; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semantical.onmicrosoft.com; s=selector1-semantical-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vthTw6sY13KqopZR6pfsff7+4A/35kuZKeiHWocGT+Y=; b=ckGthAmcHeJM6W6kAfk3yYPAGweQYPWiBq6EeMfO9sgDdzfYHmB6y0jG5h4cJWeQ5A4pCMfTzU3sHYwYhnnaK04I1Es/krQqwfAQoucbuiUMIIasMBIfskcuTXH0q+DrHwqt0k87ZNV0tIBy22C9vIfgF4Nb9XNYERUST8qkjYc= Original-Received: from LO0P123CA0007.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:354::16) by LO4P265MB6697.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2f5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 1 Apr 2024 15:37:53 +0000 Original-Received: from LO1PEPF000022FC.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:354:cafe::69) by LO0P123CA0007.outlook.office365.com (2603:10a6:600:354::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Mon, 1 Apr 2024 15:37:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 178.79.136.144) smtp.mailfrom=masteringemacs.org; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=masteringemacs.org; Received-SPF: Pass (protection.outlook.com: domain of masteringemacs.org designates 178.79.136.144 as permitted sender) receiver=protection.outlook.com; client-ip=178.79.136.144; helo=semantical.co.uk; pr=C Original-Received: from semantical.co.uk (178.79.136.144) by LO1PEPF000022FC.mail.protection.outlook.com (10.167.240.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Mon, 1 Apr 2024 15:37:53 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 7E701114002; Mon, 1 Apr 2024 16:37:53 +0100 (BST) In-reply-to: X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO1PEPF000022FC:EE_|LO4P265MB6697:EE_ X-MS-Office365-Filtering-Correlation-Id: ac418c8c-03a3-4794-4bca-08dc5261b246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 03uQAadqkH4HdhHxEpSj7ML9Z8fwjSrJY9nnkE0h4x8uMsBvPXJUWN8pnEt82zUvjgmgnszd1vGGLvVxKYE0f1E7AmIJdFZa2KlHHG9U4f2aJz/bd/tE2Bv/7nKDW0fnPD7+LiRqGLOt1GflAVMYf2I7Pl7FnpY3cBAY9C8kjMNJOJpVTTpYUdWqD2AK7vNbxLSJozJdH4nVUEnBJx72GAvsu03y+DDHIjeDKpkhyIJc6wfsf99lJ7ZxaIIzp0byaiG/Ax8GRW6xOLPGK8Y4rq8RYEapCInTft295mxHK9Y57tR//U/FqLRf9ztCMPZdJufllLxMXLFqOO352yijTe/6pqYVkcD3/HyNdPwfRozhBWLmU0SLeuYZ153sBWDVVj9D7gtMSlA3g7YhROO2gBodT5ostN74eSXvR7S2XMt9K/offRjWCjcjR7KCoaWj/Me8mX6N2zob4mp94Hkx/TrRbPOs7jk8HquVDVEaGpLe07yYFxIMoKTu0TMrHK438nC5MVCFBCSW6lRhAq7joDwPTSwmdoQDNWIOy2D6wn2ANp5I7erIb3ndhnyLuXvD6FwjSTpiJPBBNetU7quRFXJpLXLK5qOGN1iVj1fN7Gs4sAUCKJvZRAqAL79nuMt6M2GyEJSA/RDNCcNIqtUyTby7F02NCFvAb2CsrNf0mttXEyIdJhPP4sGpHQVxGbcF4r6IRJOTNigj8PaT3XXGPbQcisW1Tad2PNSPGurA7H7KQHHSNNkRqzGt5dqvM V2j3kjy/dNLl8ll1VHM2GQX6WCRN1Ar1W5Su/0c0i82OSq71oEvXb7PluCzm8rsUOKd X-Forefront-Antispam-Report: CIP:178.79.136.144; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:semantical.co.uk; PTR:semantical.co.uk; CAT:NONE; SFS:(13230031)(376005)(36860700004)(82310400014)(61400799018)(79816003)(14776008); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 15:37:53.5555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac418c8c-03a3-4794-4bca-08dc5261b246 X-MS-Exchange-CrossTenant-Id: a4e27e3d-bab0-45e8-8942-e64cf9fbd34f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a4e27e3d-bab0-45e8-8942-e64cf9fbd34f; Ip=[178.79.136.144]; Helo=[semantical.co.uk] X-MS-Exchange-CrossTenant-AuthSource: LO1PEPF000022FC.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO4P265MB6697 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282482 Archived-At: Hi Stefan, Stefan Monnier writes: >>> This obviously goes into the C core where a bunch of stuff takes >>> place. One of variables that gets updated (somehow) is >>> `current-load-list'. Curiously, it ends up with duplicate entries. I'm >>> presuming there is a good reason for this. > > Duplicate entries sounds like a bug (unless there are two calls to > `defalias` for the same function name within the same file). > Do you have a reproducible recipe that shows this? > That is exactly the scenario. There's a setup function that gets called, which in turn sets up the defaliases. Each test would then end up calling this setup function, which would result in the same file foo.el calling defalias multiple times for things it has already defined. Still, I find it a bit odd that it's *that* slow. We're talking hundreds, not millions, of entries. As I mentioned earlier, I do not think it's a bug, but it caught me out, so I figured I'd at least ask. >>> This variable can easily get overrun with identical entries if the >>> inattentive programmer does not check if it is already bound. > > Hmmm... I'm beginning to wonder: do your `defalias` happen while loading > a file, or do they happen more "dynamically"? > The file is loaded once as part of the batch emacs process to run the tests, and unless there's some ert shenanigans I'm not familiar with, I do not think so. >>> I have not narrowed down exactly *why* my ERT suite, when beset by 600 >>> tests to run in one go, causes the slowdown. What I'm guessing from >>> how each successive tests slows down, that there is some sort of >>> non-linear searching going on here, and either `load' (and friends) or >>> the mere fact that putting more defaliases into the system causes this >>> slowdown to occur. > > The most common culprit is "N linear searches in an N-long list". > Stefan