From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Fussner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers Date: Thu, 9 May 2024 07:38:22 +0100 Message-ID: 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> Reply-To: David Fussner Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000f79e30617ffabba" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34479"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53749@debbugs.gnu.org, Ikumi Keita , Arash Esbati , Stefan Kangas , Tassilo Horn , Eli Zaretskii , Stefan Monnier To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 09 08:39:51 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 1s4xRW-0008vo-ML for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 May 2024 08:39:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4xRJ-0001lU-Pb; Thu, 09 May 2024 02:39:37 -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 1s4xRI-0001lI-Bk for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 02:39:36 -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 1s4xRI-0008Vf-3O for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 02:39:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s4xRh-0003tb-RM for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 02:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Fussner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 May 2024 06:40: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.171523674914936 (code B ref 53749); Thu, 09 May 2024 06:40:01 +0000 Original-Received: (at 53749) by debbugs.gnu.org; 9 May 2024 06:39:09 +0000 Original-Received: from localhost ([127.0.0.1]:53381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4xQq-0003sq-MZ for submit@debbugs.gnu.org; Thu, 09 May 2024 02:39:09 -0400 Original-Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:61553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4xQo-0003sP-4C for 53749@debbugs.gnu.org; Thu, 09 May 2024 02:39:07 -0400 Original-Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1ed904c2280so2917865ad.2 for <53749@debbugs.gnu.org>; Wed, 08 May 2024 23:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1715236714; x=1715841514; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Xf5HSIsrmJ8f17pLsVSc85UxUAYMSIOZiVBmLoDAIxY=; b=jQ9aEHs2QEw0xEkqwIL8DJg1xa3R2g/7JZImpP0n95ji/sqSvB5v1yCCPI/wVNOOHu BGJugXZw7nrEoZnuaI9Z1aSxkDJ6KfqYr37ldI2HxMsaOpwtCpUWPC0xdhC8Yq8exVWt 5E8tKLWivglSQJKYnHFhMDryj/r6BUyVaAvkSdmk1LYA5DZolBP7aPKr46o8wSmiHNfH wWocpPpsX9hSPUgAr+E60MCVUzbRltEzF3uhJzMEFWoQrNdczvFittXoGvAhJnErjyge ++gB2gpLafK3ynDPUUhNiuZ6qf/mx+kGx7M6VNmBPtOEDIHCZTLqSNcoSzE/pcZ4DsAs z8vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715236714; x=1715841514; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Xf5HSIsrmJ8f17pLsVSc85UxUAYMSIOZiVBmLoDAIxY=; b=HTzhiTf5GlPe3zwsiNxMeCs8adjkl72iI53rxHNR9nswPHUpOm3eRZvCXMczJ29882 4fPlnfOkNnxhAi7+G+bdWw8SK7Ye+grDRmIpUfFCFaFC4lsprcf1Zyo9TPTAsoNE8mNZ sBQBweT2wcUSz4B3SaOToqKZtT6C1Xc2nDhSEOeow0jL7pyjFajMHROi2oXGyLRdhRX0 /P0zC7k3PkoVevqUmWZ5T1DsNmsrN7pxYg/mF3aUuoiOuOZCuyuw8nuzixpAtbFg2eXj b8oWOd4jo1Sz5VPaPWCMLafRWpBxiuWxXHtZyIZpL/0+SgExTW2BKAeqPfKHUtWLGSWI ZBpQ== X-Forwarded-Encrypted: i=1; AJvYcCXhhxzoTdlD5l7Ib/4jm+ep3SCIa/swHu3kk9jYOkkpOZBMvVPhs3zbyrgdAXHYcyAJCKtT3SGAXVWT6UI74v7gVBmZLKo= X-Gm-Message-State: AOJu0YxNBzWYvJfeDcnctTumj8Tx8xFrCDns9DZ7u8/E5K5YCS4rd1TE ZT0rxA0dpBxfiuJbffSBADcB0+bfjuuJJB7sEKxkJk5mBQNuSyOe9Ueosr40IbG4lrzWvnKohXK hYkAMPfl22+Cu3ZRhoz5P6fVpMTk= X-Google-Smtp-Source: AGHT+IG3MuPIbTvypdFVQOn57jIgaoYrY4xSr22XWiq0nM9kNBqHZXcjawJ08konXyH6rQTBJp90acoFUlZP375zMCc= X-Received: by 2002:a17:902:f681:b0:1ed:867:9ea0 with SMTP id d9443c01a7336-1eeb09959b0mr48124135ad.57.1715236714278; Wed, 08 May 2024 23:38:34 -0700 (PDT) In-Reply-To: <83ba27b7-4d28-4a3f-b803-4bc49f62986c@yandex.ru> 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:284719 Archived-At: --0000000000000f79e30617ffabba Content-Type: text/plain; charset="UTF-8" Thank you, Dmitry! I'll run tests later today and get back to you. David. On Thu, 9 May 2024, 04:00 Dmitry Gutov, wrote: > On 07/05/2024 05:27, Dmitry Gutov wrote: > > On 03/05/2024 16:42, Stefan Monnier via Bug reports for GNU Emacs, the > > Swiss army knife of text editors wrote: > >>> Thanks for looking over the patch. Here's the recipe for the purported > >>> bug in xref.el: > >> The problem stems from xref.el's constant abuse of > >> `inhibit-modification-hooks`. Binding this var to t should be done only > >> in exceptional circumstances and should ideally be accompanied by a > >> comment explaining why it's necessary. > > > > Well, the reason is performance: I've tried to wring out the most out of > > it, given that we have to parse the buffer for syntax in Elisp, and > > that'll always have a certain overhead. > > > > The difference between inhibiting and not could be up to 20% of runtime. > > > > David's fix makes things slower (just due to having us do the necessary > > work), but still has an edge over having no inhibit-modification-hooks. > > > > That remaining improvement is around 4-7% in my testing, though, so > > maybe it's the point where we should prioritize simplicity. > > For now, I've pushed a fix in 86187d43e2d which seems to handle David's > scenario and address your review comment as well. > --0000000000000f79e30617ffabba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you, Dmitry! I'll run tests later today and get= back to you.

David.=C2=A0

On Thu, 9 May 2024, 04:00 Dmitry Gutov, <dgutov@yandex.ru> wrote:
On 07/05/2024 05:27, Dmitry Gutov wrote:
> On 03/05/2024 16:42, Stefan Monnier via Bug reports for GNU Emacs, the=
> Swiss army knife of text editors wrote:
>>> Thanks for looking over the patch. Here's the recipe for t= he purported
>>> bug in xref.el:
>> The problem stems from xref.el's constant abuse of
>> `inhibit-modification-hooks`.=C2=A0 Binding this var to t should b= e done only
>> in exceptional circumstances and should ideally be accompanied by = a
>> comment explaining why it's necessary.
>
> Well, the reason is performance: I've tried to wring out the most = out of
> it, given that we have to parse the buffer for syntax in Elisp, and > that'll always have a certain overhead.
>
> The difference between inhibiting and not could be up to 20% of runtim= e.
>
> David's fix makes things slower (just due to having us do the nece= ssary
> work), but still has an edge over having no inhibit-modification-hooks= .
>
> That remaining improvement is around 4-7% in my testing, though, so > maybe it's the point where we should prioritize simplicity.

For now, I've pushed a fix in 86187d43e2d which seems to handle David&#= 39;s
scenario and address your review comment as well.
--0000000000000f79e30617ffabba--