From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers Date: Sat, 25 May 2024 10:57:22 +0300 Message-ID: <86v832z5lp.fsf@gnu.org> References: <2c5c8afa-b57e-3156-d21c-5523cacb4d87@yandex.ru> <831qf1mgjl.fsf@gnu.org> <87cyyj9rpp.fsf@gnu.org> <65793.1694843596@localhost> <83ba27b7-4d28-4a3f-b803-4bc49f62986c@yandex.ru> <82993b86-0f34-4adb-a392-c74db5176d14@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23527"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53749@debbugs.gnu.org, ikumi@ikumi.que.jp, tsdh@gnu.org, dfussner@googlemail.com, arash@gnu.org, stefankangas@gmail.com, dgutov@yandex.ru To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 25 09:58:10 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 1sAmI5-0005vl-QO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 May 2024 09:58:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAmHx-0001wp-GA; Sat, 25 May 2024 03:58:01 -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 1sAmHv-0001vX-E4 for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 03:57:59 -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 1sAmHq-0001NW-GN for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 03:57:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAmHx-00072K-QZ for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 03:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2024 07:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: pending patch Original-Received: via spool by 53749-submit@debbugs.gnu.org id=B53749.171662386327042 (code B ref 53749); Sat, 25 May 2024 07:58:01 +0000 Original-Received: (at 53749) by debbugs.gnu.org; 25 May 2024 07:57:43 +0000 Original-Received: from localhost ([127.0.0.1]:41930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAmHe-000726-Sn for submit@debbugs.gnu.org; Sat, 25 May 2024 03:57:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAmHc-000720-Tv for 53749@debbugs.gnu.org; Sat, 25 May 2024 03:57:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAmHN-0001HF-J1; Sat, 25 May 2024 03:57:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=8QZfVJOwOnKiLuvo7FzL9/ErNaZZFnxYaPA1A9SXbic=; b=oRrMwYgbwwpr ZUEeazV4lggtyYXodhlL4Ga+FMgEoluIGIo2M3z/c0j/mK+0YUIhwXYQ+h2ajQR6+uX3VVY6CA6Kb douxjXMW9xGdml0dVR/FZuyvXVthANHeHLz6aJcmeWxkXcxkrFObZOqdSuJhZ/FOcZmQAhlpdbZ2D 49ToRKXYJapWpa144B26SwMRtc1z5Zktlqrk36SvbaaLD0aGcN6TUMVqaM+5Bd/9zYlLzBH5cHO2z sgluYQqL+kxyghfnMogo3mgMOrLfOpY3rkd5ceMkTeiPRboiwmb4uTMoSu6CunP2AJZPkcCFZK6hF LCqoqy4ZpbzmZuK/vF7KSw==; In-Reply-To: (message from Stefan Monnier on Sun, 19 May 2024 22:38:45 -0400) 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:285835 Archived-At: How should we proceed about this bug report? Is David's last changeset acceptable or isn't it? > From: Stefan Monnier > Cc: 53749@debbugs.gnu.org, Ikumi Keita , David Fussner > , Arash Esbati , > stefankangas@gmail.com, Tassilo Horn , Eli Zaretskii > > Date: Sun, 19 May 2024 22:38:45 -0400 > > >> Hmm... not sure it's worth the trouble, then. > >> Also, it might be worth trying to see where those 4-10% are spent: this > >> is done in a temp buffer where there should presumably be very little > >> need for before/after-change-functions, so maybe we can get rid of the > >> specific offenders rather than inhibit all modification hooks. > > Given the relatively low percentages, it might be difficult to glance from > > a profiler report. I was assuming the time was mostly spent in > > syntax-ppss-flush-cache, but the function is pretty simple. > > Rather than a profiler report, maybe a better approach would be to > remove things from the non-inhibited-modification-hooks paths and see > how/if they change the performance. > E.g. replace the `inhibit-modification-hooks` binding by one that binds > `before/after-change-functions` to nil. > > >> I wonder what we do during those 20% of the time if the buffer is left > >> in fundamental-mode. > > Good question. > > It's probably the better case to investigate since it might be easier to > see the effects. > > >>>> Also, what about the other two bindings of `inhibit-modification-hooks`? > >>> The other two are used while the contents of the Xref buffer are printed (or > >>> re-printed), so there's none of the syntax-ppss complications there. The > >>> performance difference is 8.5% in my last measurement. > >> Is this 8.5% of a function that's fast anyway of 8.5% of a function > >> which takes a fair bit of time? > > When there are a lot of matches, it can take some time. Note that 100% in > > this case is the whole list-files-do-search-print-results pipeline, not just > > the printing phase. So printing is sped up by more than 8% (my last test > > says it's by 27%). > > I guess during printing if it's done in many small steps we may indeed > run modification hooks many times, so that could explain the > higher percentage. > > It still seems hard to justify 27% since those modification hooks should > usually do nothing, AFAICT. Maybe there's something silly going on. > > > Stefan > >