From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Async rebuild package-quickstart after packages update? was Re: 28.0.50; Proposal: slightly more efficient package-quickstart.el Date: Tue, 03 Aug 2021 19:24:59 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=gb18030 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26783"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Arthur Miller , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 04 04:25:54 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 1mB6bS-0006nH-9A for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Aug 2021 04:25:54 +0200 Original-Received: from localhost ([::1]:60340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB6bR-00043m-6g for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Aug 2021 22:25:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB6ah-0003LQ-Lb for emacs-devel@gnu.org; Tue, 03 Aug 2021 22:25:07 -0400 Original-Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:36837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mB6af-00076x-Vl for emacs-devel@gnu.org; Tue, 03 Aug 2021 22:25:07 -0400 Original-Received: by mail-pl1-x634.google.com with SMTP id i10so1360688pla.3 for ; Tue, 03 Aug 2021 19:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=qtYNO6LdwlSVzgdNLessUog08JSeILYieVKeTIgIlc0=; b=dtGxDtO1QyAD7F80OQYkn/ZQQ+BNBVknzQpjLGUm27h/pOuz67AXymkB8Qd+9dlJTr vICwtqrMuKJSibzlsFRnjHkJEtf+9Fo62e1IzeoS8GjjU/3kqc+Qp+6XVlz1SWjnQtg7 o33glqJhdevXaxf9pA+BZJIr/CCHMPUXOIBjJ7wmT2O53yxD+4FRiZdE9lzeG4aC4Kc1 NHg8/UrrlLVeTCHHNd/pMmPzREDHvU3M53xwuRZ0DP+gXB5BTmvRCa+zYRnVkZaVcjgl ++gDPe3qp3s5ap3I9+5h0Jzro4ZN7C+6V9UBxOEHdjUXcrhLsME6HNeosIBzvHF9YN2g 8lEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=qtYNO6LdwlSVzgdNLessUog08JSeILYieVKeTIgIlc0=; b=GTDQavrUIYjTw5NuSAlYxWNajTKUa9YqY6ZG0YYOuYbWJvXgqQZVdUG9u97yL9DBq9 Z0oamX0ZYzGckVXb4vojciFh47G5bH9gRE9HdA5xor/KrJ9MkvtMF4k79EVlLy08wFgO 0lKtXC90PPPIH+XpfLwAdScQreAQZ0VvdBjTRVDjgEbDvO6QN39WYG4rW95dIyPvGP3O JDcf0np0Io1L2i+q5vnmcFOFYwdDKFXRAS/AvdKWRSZop0E8GPruy4zrRwExRPZ64xAK YmnRj0WI/rAoNdOFoVd6OBD5Bgb8dmVYas17dzlxULctY6SHPmD7Tub9qhFx28sgAJHG gsfA== X-Gm-Message-State: AOAM533lyziaJrt4vJm4X4KNtng6w4M+ZdbiMnucnb9w93A3HuZ/Ec7e wqdlylEUOR/ZxtcVlthvTcFJRIPgVBwB+/0i X-Google-Smtp-Source: ABdhPJwk70xC2ouxosTlTBlYzyznytVYyta4ntKmaPP9Hvcok1pRuIGX3aGwrJ9od7aCiyy+gP4lxA== X-Received: by 2002:a62:d447:0:b029:291:19f7:ddcd with SMTP id u7-20020a62d4470000b029029119f7ddcdmr25428373pfl.54.1628043902844; Tue, 03 Aug 2021 19:25:02 -0700 (PDT) Original-Received: from raman-glaptop (c-24-4-174-65.hsd1.ca.comcast.net. [24.4.174.65]) by smtp.gmail.com with ESMTPSA id x2sm575299pjq.35.2021.08.03.19.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 19:25:02 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 03 Aug 2021 18:20:27 -0400") Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=raman@google.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 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:272014 Archived-At: Stefan Monnier writes: So looking at package.el: package-quickstart-refresh is called from package--quickstart-maybe-refresh and looking at the code in package-quickstart-refresh, it does not block on user input, so it may just be sufficient to change the call to package-quickstart-refresh to (make-thread #'package-quickstart-refresh) -- Thoughts? >> One place where we could gain perceptible speedup is when >> package-quickstart is rebuilt after updating packages; could we make >> that function asyn? > > Yes, that would be a welcome change. > > > Stefan > > >> 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=20 >>>> for wdired? >>> >>> In the case of wdired there was a concrete gain. >>> Here it's only hypothetical, so the positive motivation is quite differ= ent. >>> Also `package-quickstart` is fairly tricky to troubleshoot (beyond remo= ving >>> 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. >>> >>>> Last weekend I tested actually myself to restructure how my packages a= re >>>> 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 g= ot >>>> 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. >>> >>> Still, that presumes that finding a file is the main issue, but I don't >>> know if that would indeed be true. >>> >>>> (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)))) >>> ...))) >>> >>> >>> -- Stefan >>> >>> > > --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =817=A94 Id: kg:/m/0285kf1 =950=DC8