From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier 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, 16 May 2024 14:18:54 -0400 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> <82993b86-0f34-4adb-a392-c74db5176d14@yandex.ru> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10533"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 53749@debbugs.gnu.org, Ikumi Keita , David Fussner , Arash Esbati , stefankangas@gmail.com, Tassilo Horn , Eli Zaretskii To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 16 20:20:25 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 1s7fiK-0002WN-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 May 2024 20:20:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7fi4-0008MV-3m; Thu, 16 May 2024 14:20:08 -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 1s7fhw-0008LR-D4 for bug-gnu-emacs@gnu.org; Thu, 16 May 2024 14:20:00 -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 1s7fhv-0006Bq-Hf for bug-gnu-emacs@gnu.org; Thu, 16 May 2024 14:20:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7fhx-0001vu-TB for bug-gnu-emacs@gnu.org; Thu, 16 May 2024 14:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2024 18:20: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.17158835517400 (code B ref 53749); Thu, 16 May 2024 18:20:01 +0000 Original-Received: (at 53749) by debbugs.gnu.org; 16 May 2024 18:19:11 +0000 Original-Received: from localhost ([127.0.0.1]:50193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7fh8-0001vI-St for submit@debbugs.gnu.org; Thu, 16 May 2024 14:19:11 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7fh6-0001uy-RD for 53749@debbugs.gnu.org; Thu, 16 May 2024 14:19:09 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4AFD84415C0; Thu, 16 May 2024 14:19:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1715883534; bh=s7LfnzTOVMyyIaDvTVS8WGyB5p6AjT10cg1oP8XzWFI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IdMuu1C7HvZHHkTUHISsnx5QajVakm2C5/uGc4fgWH3928SBY05YLSIxUl+N+bf/W ZpPcecTHhxT9BySZYjPP6h9z4eOdEsku13MvA88kwIrRTwE7dT8azPGI/JDFgDLvPB sC8ASsP+QFkMBXTjy8sUePveONrWbfkMbvGXC8gjXs2laQa/uJKt5LXDBtd58fsICn GCxFCZdaVa3AV2mRhgnWSV5ikJ3/yWG1i56qBborMm3O3IojucDsHzpkFGbLVCB2dN RkKyRNgZ/6hcKZF28zLU6rQaG7mVIx/J7ixhBMO10g2WwMWqVqyZEhY5QGrlUekmh/ yfgD64YPn3cFQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B2B6344137D; Thu, 16 May 2024 14:18:54 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9A3DD12047E; Thu, 16 May 2024 14:18:54 -0400 (EDT) In-Reply-To: <82993b86-0f34-4adb-a392-c74db5176d14@yandex.ru> (Dmitry Gutov's message of "Wed, 15 May 2024 00:24:24 +0300") 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:285180 Archived-At: >> IIUC, in the `syntax-needed` case, the let-binding of >> `inhibit-modification-hooks` is just not useful very (4-7% is not worth >> the trouble), so its purpose is to speed up the other case. > 4-10% is the improvement for both cases (the "syntax needed" and not). 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. > Also, I'm eyeing another performance improvement (simplifying file type > detection) - the call to set-auto-mode is not fast. Simply commenting this > call out improves the performance by 4x or so - but we'll need a simpler > version of it instead, of course. > > And with the above change (commenting out the set-auto-mode call), the > difference that the inhibit-modification-hooks hack makes is amplified: it > can get up to 20%. I wonder what we do during those 20% of the time if the buffer is left in fundamental-mode. >> 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? Again, I'm not sure it's worth the trouble. But as a start, every such binding should have a comment mentioning that it's there only to gain a few percents of performance. Stefan