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#73484: 31.0.50; Abolishing etags-regen-file-extensions Date: Sun, 6 Oct 2024 03:56:58 +0300 Message-ID: References: <87tteaznog.fsf@zephyr.silentflame.com> <8734lrrj4e.fsf@zephyr.silentflame.com> <87o74c1ce1.fsf@zephyr.silentflame.com> <87jzezzg87.fsf_-_@zephyr.silentflame.com> <37e4b3cd-6363-4f55-9921-92a1182679dc@gutov.dev> <86ttdy50ja.fsf@gnu.org> <75fe4289-da41-454d-ba92-22a92ea7002f@gutov.dev> <86frpe2186.fsf@gnu.org> <8e305b6d-8ca8-4437-990f-183ebc007d18@gutov.dev> <865xqa1ggi.fsf@gnu.org> <86ttdtzoof.fsf@gnu.org> <8d7dc133-9828-4023-821f-e4403f899f81@gutov.dev> <86ttdsxt6x.fsf@gnu.org> <52cb1caa-9e7e-45df-b328-d60948d397f6@gutov.dev> <864j5rxca1.fsf@gnu.org> <87a5fiijy9.fsf@tucano.isti.cnr.it> 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="32901"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii , 73484@debbugs.gnu.org, spwhitton@spwhitton.name To: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 06 02:58:19 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 1sxFbG-0008Qj-Ad for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Oct 2024 02:58:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxFax-0001h6-Ds; Sat, 05 Oct 2024 20:57:59 -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 1sxFav-0001gy-Kg for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 20:57:57 -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 1sxFav-0004Al-CV for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 20:57:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=z8wpDMUh3MbMqIu3TOJF0EtyGAPJkafgE6gcKiJNs7c=; b=WcjH9tmn56ShIt4zA+AMfdvuQWsNj2MDIQCpdZeL1Mc2LkLDrCWWkvgFVmrBnFhXkhbQ+u+CJvNovZemfz75LUogxgLviyvjA+yZj1Ka7wfhTkUlYoHitjEcAhu7P+PMplMXwZhhrrUxswzUGdNeh2C5PMMEMAyPQ/Gb7oafhlrQPc2zpoSzX7MHyjW+7P+3DEatZPK2KofF+7H3cpGk7j6/aG7wUOFXDwpSfNOLQo8sgmi6Tp+7xZUz2wxG1goLJ61OXm2OBbf8gtmx/zPGdL9Wm+eWtajWFGMKRU43/X0cOYxcxSj2fgOBDo//nvSqpbW7Gsj9et5ZqBDfrGz5uQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sxFb0-0002Lb-HT for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Oct 2024 00:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73484 X-GNU-PR-Package: emacs Original-Received: via spool by 73484-submit@debbugs.gnu.org id=B73484.17281762378966 (code B ref 73484); Sun, 06 Oct 2024 00:58:02 +0000 Original-Received: (at 73484) by debbugs.gnu.org; 6 Oct 2024 00:57:17 +0000 Original-Received: from localhost ([127.0.0.1]:39741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxFaG-0002KX-Gp for submit@debbugs.gnu.org; Sat, 05 Oct 2024 20:57:16 -0400 Original-Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]:44973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxFaC-0002KI-Nz for 73484@debbugs.gnu.org; Sat, 05 Oct 2024 20:57:15 -0400 Original-Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 28A9411401A7; Sat, 5 Oct 2024 20:57:02 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sat, 05 Oct 2024 20:57:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1728176222; x=1728262622; bh=z8wpDMUh3MbMqIu3TOJF0EtyGAPJkafgE6gcKiJNs7c=; b= oMj4a4jaBLFzDPA2go0jeLSCrUmuqfxLM93pJBzXvpNJ5pfpIh+/+8/e6NeUhUEv gdLokMR1vj/34ZhbSJEu3j9gW0s7Ts1/cxvdqmgTtaskkK0Q32BTifowCp4S68R3 zxP1aV4u9xBm2zVlkyUm6ELibkfSMqq/mE9GPeXcONFucpYqYVCoNInxwPYPRsms J+JAnyLPSk2Xqq+85Ejb5XfduQ8lkD7WEaHk9svVkrKZoqVikwRKTtBvRYGunFu/ ddu/+x7snvYBnue3liNOorjIWZ+4jghK+ObmQnQHWDa54crXt2Pl86cmZwwlLCJp 7bftf3HtQ3186MORb9X4+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728176222; x= 1728262622; bh=z8wpDMUh3MbMqIu3TOJF0EtyGAPJkafgE6gcKiJNs7c=; b=l HypQYrFENnht5tfFmzW0Ian3ZTpJIP77a3cyHmUgifNT4hAoBWgFK4HIb3BanDu/ H1asfhgUcTW2kMbtqOFIOsrwhCFOMb5+XIiWr/uAh9GgdhwX6B55fIlrKLvWh7JB c3RC4m83lZh7YOIcxGSLz/1IPItCMgP/cydgXwjyAkvhCWBiCdS1TTiieLiUiSB4 b/L4fFN1VI0RQxhcpal3LM05MGYfZuXB48kaCtfm1P92UDJ1AMnZ9q4M3VxZtWrd wlaAadEORGuYrItowiFZiWwWu4bJOi+NkbEyq/VKXonFdjOYcynGDNAGNrBm3dn7 JcE0C+jEUQXB8bo1esxWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddviedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepfedvjeeviefffeeukeelveeikeegtddtveeileev gfdvgffhtdfggeeffeegiefgnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhies ghhuthhovhdruggvvhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepphhothesghhnuhdrohhrghdprhgtphhtthhopehsphifhhhithhtohhn sehsphifhhhithhtohhnrdhnrghmvgdprhgtphhtthhopeejfeegkeegseguvggssghugh hsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiisehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Oct 2024 20:57:00 -0400 (EDT) Content-Language: en-US In-Reply-To: <87a5fiijy9.fsf@tucano.isti.cnr.it> 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:293060 Archived-At: On 05/10/2024 19:38, Francesco Potortì wrote: > Eli Zaretskii: >>> How hard is it to add to a live TAGS file fake lines which look like >>> this: >>> >>> ^L >>> foo,0 >>> >>> (with random strings instead of "foo"), and then time some TAGS-using >>> commands with and without these additions? > > Dmitry Gutov: >> Okay, done that. >> >> 'M-.' takes more or less the same. >> >> The file size of TAGS increased from 66 MB to 85 MiB. >> >> Won't measure time to generate now - because the current method and the >> "real" one will be different, but note that it's more relevant with >> etags-regen-mode because the scan is performed lazily: every time the >> user does the first search in a new project. > > Removing the Fortran and C/C++ fallbacks just for testing requires recompiling etags.c after removing the code beginning with /* Else try Fortran or C. */. This would avoid parsing the file (except for detecting the sharp-bang) and would leave the file name in the tags file, without tags. Thank you, this is useful for another kind of test (parsing the same project with the list of all enabled file types). The below was also needed to avoid a segfault: diff --git a/lib-src/etags.c b/lib-src/etags.c index 7f652790261..08c6037b9d7 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1830,6 +1830,7 @@ process_file (FILE *fh, char *fn, language *lang) curfdp. */ if (!CTAGS && curfdp->usecharno /* no #line directives in this file */ + && curfdp->lang && !curfdp->lang->metasource) { node *np, *prev; Then, the total time increased a lot: from 30 s to 30-40 min. This cuts it down in half, if I measured correctly: diff --git a/lib-src/etags.c b/lib-src/etags.c index 7f652790261..5c2be2b9574 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1902,21 +1903,21 @@ find_entries (FILE *inf) /* Else look for sharp-bang as the first two characters. */ if (parser == NULL + && getc (inf) == '#' + && getc (inf) == '!' && readline_internal (&lb, inf, infilename, false) > 0 - && lb.len >= 2 - && lb.buffer[0] == '#' - && lb.buffer[1] == '!') + ) { char *lp; /* Set lp to point at the first char after the last slash in the line or, if no slashes, at the first nonblank. Then set cp to the first successive blank and terminate the string. */ - lp = strrchr (lb.buffer+2, '/'); + lp = strrchr (lb.buffer, '/'); if (lp != NULL) lp += 1; else - lp = skip_spaces (lb.buffer + 2); + lp = skip_spaces (lb.buffer); cp = skip_non_spaces (lp); /* If the "interpreter" turns out to be "env", the real interpreter is the next word. */ But parsing HTML files seems to remain the slowest part. There are a lot of them in that project (many test cases), but maybe 3x the number of code files, not 60x their number. And they're pretty small, on average. If somebody wants to test that locally, here's the repository: https://github.com/mozilla/gecko-dev