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.bugs Subject: bug#42966: 28.0.50; vc-dir: wrong backend Date: Sat, 24 Oct 2020 02:53:35 +0300 Message-ID: References: <87d01imtwl.fsf@gnus.org> <3708c3db-df78-1a50-857a-595f2412e284@yandex.ru> <87v9fa44im.fsf@gnus.org> <1e9908c7-337d-9790-cd37-5232bc04233c@yandex.ru> <875z79z5mw.fsf@gnus.org> <52df0404-979f-872b-a60e-5259c0893f15@yandex.ru> <87wnzonful.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36623"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: Lars Ingebrigtsen , Sam Steingold , 42966@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 24 01:54:10 2020 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 1kW6sr-0009QA-H8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Oct 2020 01:54:09 +0200 Original-Received: from localhost ([::1]:41522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kW6sq-0008Pv-Ee for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 19:54:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kW6sk-0008Pm-6q for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 19:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kW6sj-00059J-Tc for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 19:54:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kW6sj-0003sB-QD for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 19:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Oct 2020 23:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42966 X-GNU-PR-Package: emacs Original-Received: via spool by 42966-submit@debbugs.gnu.org id=B42966.160349722914867 (code B ref 42966); Fri, 23 Oct 2020 23:54:01 +0000 Original-Received: (at 42966) by debbugs.gnu.org; 23 Oct 2020 23:53:49 +0000 Original-Received: from localhost ([127.0.0.1]:58704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW6sX-0003ri-BB for submit@debbugs.gnu.org; Fri, 23 Oct 2020 19:53:49 -0400 Original-Received: from mail-ej1-f66.google.com ([209.85.218.66]:38944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kW6sR-0003rQ-U0 for 42966@debbugs.gnu.org; Fri, 23 Oct 2020 19:53:48 -0400 Original-Received: by mail-ej1-f66.google.com with SMTP id qh17so4653786ejb.6 for <42966@debbugs.gnu.org>; Fri, 23 Oct 2020 16:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8GYQoIF/xwmB4uL3p9VVFI64xXgWc4J6FetzGTdjuLc=; b=bn5nB578MUevrywibnbxdixaObtcB96QEkWS87Q8HyZle3Wn/l99o52jn5u8hf4fuV 5dWqVtIaG5R6d51PXNW4joqjyFtHNwKNyvjP+vquYGs1jXf6eWZCoyjukhODbm+AmEer oKyjq3uWBawH7Bb++t75Q/P0NmC1opPgNWm+tbx3zmBqyZqtaImQj5RZdD0I0mo20B9v 7yZSMNEl73y/moXLlK36JpaPsWKO5PAHb3f3hlI6hqSjj3bisYgEdSbDZT4cnMAfniIC EG77IluwgIBw+3Rxej28S00I3Myh1XaEW90vuowrsN4gsjRAFrcy6obHIxNoCUZJCGjW EcPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8GYQoIF/xwmB4uL3p9VVFI64xXgWc4J6FetzGTdjuLc=; b=myQN4dE3oL1usUSzMDfTp7eZyeYbvN/7/TF9oJI+8fQ+hVSAVixeCoi4ldSR9yy1wA /c4dFBS/KkUorkFcMpa4PhtjEzXhlivwoBM5GEKqJmafsmZfcw3lbGFQQ0X8JHgg99oP G3eQeJOTfEDyfrbQUWgqtix6DB0waSkZ/J+HKtnMEXjpnUZdwNnV+tAta9KUseS12uaO 4RByqXMifV0vpjXgcMjbLeBGHvXRiaoG0nmYVUgzYBkpozEQKCXNfvSeTpfuE8hpLSQN zFdOO1Pc4NYdxty/0ZLrmyvJxwCM5UEqN/y+5Vy94fumKD5tCp8aKmbUymLPIk3ApmNp 6zdA== X-Gm-Message-State: AOAM532hpBk1xcUBW6zNeSXnlWoO1G4rYDaLmue9cS7kf7pHfdC2eR9a bi6VFDO7BOVpuSgqDi+MNeMzaDIH1f9BWA== X-Google-Smtp-Source: ABdhPJxZ3AIHIZWMLoUnuXXsTr+45Sh8kIj/Zhr2KG6XIzzX0e031Yq/o6quyN8g4oll9oS0rxSBmA== X-Received: by 2002:a17:907:43c0:: with SMTP id ok24mr4420391ejb.385.1603497217557; Fri, 23 Oct 2020 16:53:37 -0700 (PDT) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id j22sm1390095edp.77.2020.10.23.16.53.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Oct 2020 16:53:36 -0700 (PDT) In-Reply-To: <87wnzonful.fsf@gmx.de> Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:191404 Archived-At: Hi Michael, On 18.10.2020 10:38, Michael Albinus wrote: >> I don't have a strong opinion on the remote performance, but we might >> want to ask Michael. Looking at the code, it seems to have forced him >> to unfortunate measures in the past (such as adding said caching to >> vc-git-root). > > I didn't follow the thread closely. Could you pls explain, what you find > unfortunate in Tramp, and how to fix it? Not in Tramp, but I see an old change in VC that was most likely informed by a performance problem in Tramp. See the commit a40c87a0093. It adds caching of the result of vc-git-root to a VC property 'git-root' on the file name. There are a couple problems with that: - If FILE is a directory, this cache will never be invalidated (for plain files, vc-file-clearprops is called from a number of functions, including vc-refresh-state). - We don't do this for any other backends, which leads to inconsistencies in behavior, as well as surprising results, like when we did that performance test earlier. I think this is the reason for it. If we did this uniformly for all backends, we could perhaps find better opportunities for caching and invalidation. But before we look into that, could you try reproducing the original problem? Does the change below still make some scenario perceptibly slower? diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b1880c0f7b..91554bb6d8 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1573,8 +1573,7 @@ vc-git-extra-menu (defun vc-git-extra-status-menu () vc-git-extra-menu-map) (defun vc-git-root (file) - (or (vc-file-getprop file 'git-root) - (vc-file-setprop file 'git-root (vc-find-root file ".git")))) + (vc-find-root file ".git")) ;; grep-compute-defaults autoloads grep. (declare-function grep-read-regexp "grep" ())