From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: 28.0.50; Proposal: slightly more efficient package-quickstart.el Date: Fri, 23 Jul 2021 19:00:11 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19854"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 23 19:15:53 2021 Return-path: Envelope-to: ged-emacs-devel@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 1m6ym8-0004xb-S8 for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Jul 2021 19:15:53 +0200 Original-Received: from localhost ([::1]:45160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6ym7-0000pJ-Rj for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Jul 2021 13:15:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6ybv-0002fp-61 for emacs-devel@gnu.org; Fri, 23 Jul 2021 13:05:19 -0400 Original-Received: from mail-db8eur05olkn20826.outbound.protection.outlook.com ([2a01:111:f400:7e1a::826]:47969 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6ybs-0005wd-KO for emacs-devel@gnu.org; Fri, 23 Jul 2021 13:05:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fBgVS3bYVfZNVXS+blMVqVBSZhOyiHRtyBcnuC3FWzSb/EdnEVFJG7eF0eFmpIq2ahOgwPSL9WN6iir/YSHYDY42DhysBmzSDhJBq3Z/tsX/w28uobIcIgZZE7yLB+UrMqeSDhf5Fpiow9xrClps5N6iea6IJBHrF94Z5ZgtAqAPwb0FS0eL2Z6QZznYM9b7bQ/frBqT99pgCxNdd0yC5dWGYp1dxPKY2mVDIHey1viQVT97WoFxhOoCqAvQr1D+AMBTOACK8Eob7lnZxEjtD2z3GdF48VGtFO3f1UBrgQhC0UWkTQ1LXGHQVNOekmG7PAVDGRWumY5cZJ6RwkfTbA== 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-SenderADCheck; bh=dIrJ1vJaB4YuAA+3tLI+3xfEoU/1t+qfcFyUBy5yjmw=; b=KmYPpoVY5ocvV8/OM4gQsxq+vxdUOw34AIfead6/MDPJrPXs/IsJ2bOVifvIXkIAPSmVrYjQZR6DORTdIK0ueyAkkFUZWgfdo2hrOcpgDgTo7RwRO5QF/ElTosWFK/6XVS5eOAVOwLwRB8X9AGl8KIeU1KVkzYrxrHkt3vj/FxMa58bH42lOGVwXNfbVFt+P6+uMWOrNoyAphXPH6rvLgfEju+r7cYsC/7bcSIeXlX4IlXA5hPu6JS3Cy3MySPFZ+rUF0sVcuWQ9YmnE5yXfD7pAsyCjhvorjvmaCCjf9WSvY7oDe1nvZsOnF801Mgx9PozE8VdOvRcn6uToIlITzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dIrJ1vJaB4YuAA+3tLI+3xfEoU/1t+qfcFyUBy5yjmw=; b=HwD5FUPZYeKHL35l0nwfpYQl9VXYJJNTayJ6oO1VyQVly1aCGHs5DNnI7EErsUzqILsgumYut3OS76BJ6AJ4sc1s0d6oWAFMg822yHeCNU8OU8KQCBvYvmH2pXoeM2JxzHIFHclcQI0HvlAl6DNB7PQz+p/eJXmZUsme/SLE7yZ2XYU/m9Dl+d+nC9sUuFViZzLdKObh+tU4n263qGizhAiLctVPiNV0q9PAwYhTMPvqV7Xdhv2+H/H+UXp+g8eoOOaXZtEyC6DjZHXCj4V8VtsgIgLiLexSAQFCGmVrCh0oH71ZCyamR8bZ3HsVqO4ayg6r8uKutnIis8eelShIng== Original-Received: from DB8EUR05FT054.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::51) by DB8EUR05HT225.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::478) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Fri, 23 Jul 2021 17:00:12 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc0f::44) by DB8EUR05FT054.mail.protection.outlook.com (2a01:111:e400:fc0f::111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 17:00:12 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F4F6C1FB1653D58BBCFA511FCC5C7EB9733EEB5E3FB064B1A8C7AE22152AE414; UpperCasedChecksum:817A1AF2562898F551D93A3451DC3F2ED88BEB0F4D85AC70EF19A384E350EE03; SizeAsReceived:7775; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::e47b:760e:fa35:f28b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::e47b:760e:fa35:f28b%7]) with mapi id 15.20.4352.029; Fri, 23 Jul 2021 17:00:12 +0000 In-Reply-To: (Stefan Monnier's message of "Fri, 23 Jul 2021 10:36:34 -0400") X-TMN: [5/B/ODrIpUtxWOCaiBp384HTbaXJFZE9] X-ClientProxiedBy: AS8PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:20b:310::20) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87tuklm0dg.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AS8PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:20b:310::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26 via Frontend Transport; Fri, 23 Jul 2021 17:00:11 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 5713a5f6-717f-4d7d-cc03-08d94dfb559c X-MS-TrafficTypeDiagnostic: DB8EUR05HT225: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MbCIYsrcDP5d0ZmF3MxDc5gIWIDq6BmDZgyxoM9TnWTbGfvSqnUdUoguGL35Ob0xaSnlN1ia5Suhgz54K5KukvbIN9aCNIMLhgIcGZmJqMIoo7gUNi6XsVNJAaBOULFREg+Gfz0Z03wfcHvqfR3ClYKjiv3SdUOjZ5wxwsptQNDTpQiVyQPeek8+a1amc/N9t7T4FvbdzvLaHKY81AinjwSOMH4XX5euNs7f4jc6c0g4RgSpDD1840ZqvAUes+pEfUVF22v63h0Ohk5knVhapGZ7fohEWNDaGEuNlBqHkgTadOI22Bm/4uCL+4/l7oTE8iqdSOo6bAMqMJRTryb0UjOFWSqSHxQncfUkIZFeZtKjxc4PvaC32thGbdjOAFtwgf2evZ+N3qbDJHakptTh9P6mh1dT1IEQv37e7KMTl0+pvSIRCMBU/dgbONXg+ToK X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GyJBEimTvCxSiG4Py8TbMAtjqoL/P7NMKo3L3NRAuHeQwJrPWrn4/YbO9iGzHhzmPQsH8bfhGypQ7DhmOb9RBcH4/LgZuCpYJAh9bZLhZoXpuXyah7u8Rg5TW3d5IacpoGG90rjrBPmqiFqsT4WKsQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5713a5f6-717f-4d7d-cc03-08d94dfb559c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 17:00:12.3013 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT054.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT225 Received-SPF: pass client-ip=2a01:111:f400:7e1a::826; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-obe.outbound.protection.outlook.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271504 Archived-At: Stefan Monnier writes: >>>> Not so much, but it is not so much about noticable difference, more >>>> about not performing unnecessary computation. >> I agree that simplicity and code clarity is important, on many >> levels. But maybe we can have the cake and it it too, as you said >> for wdired? > > In the case of wdired there was a concrete gain. > Here it's only hypothetical, so the positive motivation is quite different. > Also `package-quickstart` is fairly tricky to troubleshoot (beyond removing > or refreshing the file). To the end user it's largely a magical button, > so it's really important to make it work reliably. > > IOW the incentives are strongly opposed to your proposition. For me the positive motivation here is to not do unnecessary calculations, not so much the speed gain. I don't understand why speed is the only measurement of improvement. Even replacing 'add-to-list' with a 'push' to load-path would be an improvemnt, but the patch would be not much different. Anyway, if there is no incentive to change this so it is :). >> Last weekend I tested actually myself to restructure how my packages are >> loaded. I noticed that init time increased after I added ~100 packages, >> just for test, and I didn't required anything of that into Emacs. So I >> tested the idea to put all .elc file into a single place and skipp in >> entirety this monstrosity of load-path that results after 200 packages >> are loaded. I got it to work to a degree, it least I got running Emacs, >> native compiler not complaining and most packages loaded, but I also got >> some cyclic dependency, notably for dired and semantic of all things, >> that actually rendered entire session unusable for the most part. I'll >> leave that for another day when I have some more time. > > Moving the .elc files to a separate (short) list of directories indeed > one way we could address the situation where there are too many entries > on `load-path`. > > Another way would be to scan `load-path` "once" and populate > a hash-table from that, after which (load "foo" ...) could be sped up by > looking up "foo" in the hash-table. Sure either could work, hash table would probably be faster since it would effectively be a database in memory, but it also means it will cost more in RAM and also be even more complicated since you will have to modify how require works. Copying over .elc files in some kind of "package-cache" after the package installation is done is probably less change. > Still, that presumes that finding a file is the main issue, but I don't > know if that would indeed be true. For me the main issue here was to skip needless work :). I think the things wouold be speedier, but I don't know how much of that would be percieved by the end user. Requiring features is not very frequent issue, and most of it is done anyway at some well defined points like emacs starting up, or loading a mode or something similar. >> (when (re-search-forward rx-path-beg nil t) >> (goto-char (line-beginning-position)) >> (setq temp-point (point)) >> (forward-sexp) >> (when (search-backward file nil t 1) >> (goto-char temp-point) >> (kill-sexp))) > > I'd do something like > > (while (re-search-forward "^(add-to-list" nil t) > (goto-char (match-beginning 0)) > (let ((start (point)) > (x (read (current-buffer)))) > ...))) > Ok, thank you. I haven't used 'read' yet so I wasn't thinking in that direction.