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#58860: 29.0.50; [PATCH] semantic/fw.el: speed up the 'semantic-find-file-noselect' Date: Sat, 29 Oct 2022 09:31:01 +0300 Message-ID: <83y1szi1ju.fsf@gnu.org> References: <1181651021.466162.1581309285621.ref@mail.yahoo.com> <1181651021.466162.1581309285621@mail.yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26548"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58860@debbugs.gnu.org To: lin Sun , Lars Ingebrigtsen , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 08:32:22 2022 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 1oofOI-0006ln-5B for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 08:32:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oofNz-0003mf-Qx; Sat, 29 Oct 2022 02:32:03 -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 1oofNy-0003mK-I9 for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 02:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oofNy-0001CJ-A1 for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 02:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oofNx-0002ak-UR for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 02:32: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, 29 Oct 2022 06:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58860 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58860-submit@debbugs.gnu.org id=B58860.16670250799894 (code B ref 58860); Sat, 29 Oct 2022 06:32:01 +0000 Original-Received: (at 58860) by debbugs.gnu.org; 29 Oct 2022 06:31:19 +0000 Original-Received: from localhost ([127.0.0.1]:34825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oofNH-0002ZV-9j for submit@debbugs.gnu.org; Sat, 29 Oct 2022 02:31:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oofNF-0002ZF-7x for 58860@debbugs.gnu.org; Sat, 29 Oct 2022 02:31:18 -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 1oofN9-00016B-6v; Sat, 29 Oct 2022 02:31:11 -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=ILGer7aRX9Z/pTPdYfO3eQlbfCq37OmjMYDmYxZhufg=; b=plJGLzt0MMuB 5uk3C9LeYqGBu7ynQ8mpGI2wY+ZRS8yMI8mBGguwLQp54YlQr0OP946jpKzSGsUrC/bDryBH4E1oc 7OQ2gAxtgeI/RKVUDZoCtJ9yb45z4GM4S+Z3OssgtmyQYx93e1AIQbcUWj8s3CZPzV3eP6MumM6Qb dKZKrlUbMUdjtdY/kDaTNrCDn3gFiq9GEqC+6UC4KkHzGOMSg0u5Zn41EP4UC7eYte48vYv9UJdht D1SDM4FXOYIwzYRDuPfVmkkp4fF9y9pRhdze5M//h8U0rLEbAi82/1cIaFNNSEkmVIuDXjUnbEW6e nlRa9WMqe7JwtBxMqlZ2/A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oofN3-0001uf-QT; Sat, 29 Oct 2022 02:31:09 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246488 Archived-At: > Date: Sat, 29 Oct 2022 05:01:42 +0000 > From: lin Sun via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > The emacs will be extremely slow after I first time enable the > semantic mode and open a simple C source file which includes the > stdio.h. > I find the semantic mode will try to analyse the chained header files, > by calling the function (semantic-find-file-noselect ...) to open the > file and analyse its content, while the `find-file-hook` may have many > heavy functions. > Disabling the `find-file-hook` do have great performance improvement > for semantic mode. > Please help review this patch. Thanks > > > From 7ae72df1680f405d4b8d718fb13015e002e0076d Mon Sep 17 00:00:00 2001 > From: Lin Sun > Date: Sat, 29 Oct 2022 00:00:07 +0000 > Subject: [PATCH] * semantic/fw.el: speed up the 'semantic-find-file-noselect' > > Disabling the find-file-hook for semantic-find-file-noselect to > improve the performance on semantic chained source file analysis. > --- > lisp/cedet/semantic/fw.el | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el > index 9917c4c..cf5c60b 100644 > --- a/lisp/cedet/semantic/fw.el > +++ b/lisp/cedet/semantic/fw.el > @@ -361,6 +361,8 @@ semantic-find-file-noselect > (enable-local-variables :safe) > ;; ... or eval variables > (enable-local-eval nil) > + ;; also disable the find-file-hook > + (find-file-hook nil) > ) > (save-match-data > (find-file-noselect file nowarn rawfile wildcards)))) > -- > 2.7.0 Thanks. But I don't see how we can override customizations of users and modes in such a brutal way. find-file-hook is an important method of getting Emacs to do something when a file is visited, it is used for many different things in Emacs. I find the change you propose too drastic for my palate. We certainly risk breaking some other use cases. Lars, Stefan, WDYT?