From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Subprojects in project.el Date: Sat, 26 Nov 2022 00:33:52 +0200 Message-ID: <184362df-01c7-0771-28b4-a87ea52ca45e@yandex.ru> References: <87zgcq68zp.fsf@ericabrahamsen.net> <84781346-5b88-2be5-38bb-02696fcf1364@yandex.ru> <87o7t2vj19.fsf@dfreeman.email> <877czqtyfy.fsf@dfreeman.email> <87zgcml7g7.fsf@gmail.com> <2ba04533-097a-a1da-ff3f-2c9506fd488e@yandex.ru> <875yf9bbzb.fsf@gmail.com> <87wn7oa0aw.fsf@gmail.com> <7a5b76fd-fb15-8c1e-ea29-bf11f7e0d2ae@yandex.ru> <87bkoya815.fsf@gmail.com> <0024a67d-b8e5-b35c-1b22-82541a170eb3@yandex.ru> <871qptai4d.fsf_-_@gmail.com> <71addecc-373e-b1f0-f190-0ce3531626a8@yandex.ru> <50bf9e49-23f0-0966-f619-88bcf35479fa@yandex.ru> <871qpqvme6.fsf@gmail.com> 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="38366"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: Stefan Monnier , Danny Freeman , Eric Abrahamsen , emacs-devel To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 23:34:20 2022 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 1oyhH2-0009jE-JB for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 23:34:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyhGi-00055l-5R; Fri, 25 Nov 2022 17:34:00 -0500 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 1oyhGg-00055H-8J for emacs-devel@gnu.org; Fri, 25 Nov 2022 17:33:58 -0500 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyhGe-0002Vl-Gr for emacs-devel@gnu.org; Fri, 25 Nov 2022 17:33:57 -0500 Original-Received: by mail-wm1-x332.google.com with SMTP id ja4-20020a05600c556400b003cf6e77f89cso6998727wmb.0 for ; Fri, 25 Nov 2022 14:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=gXKjoWqtb7wToACqalnM3Lp/RnGSku8b4H2WZ1XRAQE=; b=Y2LezbITgU0pGjW5MtnAf00FgLVQ8qVW2HfbAE3L0eHwo+NaPTl0BSJjjp1/BhrJn2 4pkKpVKwEUQ+BjCB70yYWXQ5uLMTnurhnykVPEa9tdB/CYvHX5pnA40MPe6UoJ779c4n 64gRrpXeRE65q8KDBQa4PpeFq9BjaJWkkh5XQo2CkYUDs3q8kKFunz7Y4vAbHdsYEhuE lgYWFKspZIRgWoHrWWHzqeEIHP5azn4DHc8/i32oZQy4jBvLTxVYNoNes0DIlx4aMw4w vtEIjmRaR7nJOi7jEYASaf0yMDl4Svz5hAOSxixzhFX1NpwCDPaRnFubz0zwstBcoEaA 2rpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gXKjoWqtb7wToACqalnM3Lp/RnGSku8b4H2WZ1XRAQE=; b=d5gA0lJhaspkQr/wfBLDoHJUlzRIOryeus3M+ccjG6Jxbla1AnmAzHnFD+HLpqwC3N FpWj8IgC3QCakjLkl46U2ahmaJa+hlr5Djdg6UAXwALIo9GTFAhEd5v+cvR+PQOx3tHx XwTRHQIQo5hnOzBoKIV6KqQv2HOrdzqLWcqHTDroUJD5X7wQItx1uRRRbXWL+CHQZcYd 3XJKkBiXM/3INaMV91MjI0D267EG6qNMRI9IMpaIczH3EkK3UCrJo5pJkyU5qi0VW9Lg jY4R4jJRPyimX0ChHExJae7IQmEGgLlQB344HEG5RCcecMnfmyxLsCfpFc9VeSWrdcVh zbHg== X-Gm-Message-State: ANoB5plQn+4R9Z7ifq7eAWUH3eu0yZeZMLCbwe5tUUgLH6oyhxqc126t 4feBO8C4Lyh4qIOTRapJNDdf0eIzPEs= X-Google-Smtp-Source: AA0mqf55+ChuVDtPQiKEERQmStVvYefr9+mEPQvpNz565fFeFrKYEiVmYhrJ2db6EOblcESOhubO9Q== X-Received: by 2002:a05:600c:4891:b0:3cf:d367:2765 with SMTP id j17-20020a05600c489100b003cfd3672765mr33610723wmp.12.1669415634763; Fri, 25 Nov 2022 14:33:54 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j15-20020a5d452f000000b002416e383e1csm4689421wra.25.2022.11.25.14.33.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 14:33:54 -0800 (PST) Content-Language: en-US In-Reply-To: <871qpqvme6.fsf@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=raaahh@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.243, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300528 Archived-At: On 25/11/22 21:56, João Távora wrote: > Dmitry Gutov writes: > >>> Have you seen the code I posted? You'll notice that it doesn't do >>> any file system operations, it just does file name operations. And >>> those run in CPU/memory, not file system. So I cannot understand >>> your argument.  But I am happy to measure performance in different >>> scenarios, if you'd like to suggest a particularly problematic one. >> >> I am commenting here on the idea to "Call all members of >> project-find-functions". Members of project-find-functions do file >> system operations. >> >> And that's what your piece of code does (call all members): > > I don't expect a large number of member functions to exist there, > though. At most one function looks for .git and another looks for > markers like venv (or like in my example doesn't look for markers at > all). Even when there are just 2 of them, it's 2x the initial delay, which can already be noticeable with Tramp. E.g. my ping to the "mainland" is around 100ms. And filesystem operations might take several roundtrips. Further, the approach you mentioned (running all functions on the hook) implied that there will be more of them than one -- for different project kinds, simple markers or etc. Otherwise there would be no difference between doing that and just what we are doing now. > I really don't expect this to be a performance sink. But since it's > easy to be wrong in these guesses, we can tweak the function that looks > for marker files .venv to only search if a current parent project is > there, just like my example. > > If, on the other hand, the user's goal is to search for _both_ .git or > .venv (maybe she has some non-git venv projects) then we're just going > to have to look for two files and that's that. I don't entirely understand the algorithm you're proposing here, but it sounds vaguely like what I'm writing now, so you might like the result.