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#58860: 29.0.50; [PATCH] semantic/fw.el: speed up the 'semantic-find-file-noselect' Date: Sat, 29 Oct 2022 11:06:29 -0400 Message-ID: References: <1181651021.466162.1581309285621.ref@mail.yahoo.com> <1181651021.466162.1581309285621@mail.yahoo.com> 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="7942"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 58860@debbugs.gnu.org To: lin Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 17:07:23 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 1oonQf-0001s4-Ic for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 17:07:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oonQN-0003KH-Bj; Sat, 29 Oct 2022 11:07: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 1oonQM-0003KA-M6 for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 11:07: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 1oonQM-0004KY-Es for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 11:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oonQM-0003aR-A8 for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 11:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2022 15:07:02 +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.166705600013756 (code B ref 58860); Sat, 29 Oct 2022 15:07:02 +0000 Original-Received: (at 58860) by debbugs.gnu.org; 29 Oct 2022 15:06:40 +0000 Original-Received: from localhost ([127.0.0.1]:36352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oonQ0-0003Zo-5v for submit@debbugs.gnu.org; Sat, 29 Oct 2022 11:06:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oonPx-0003Zb-SA for 58860@debbugs.gnu.org; Sat, 29 Oct 2022 11:06:38 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 45A348079C; Sat, 29 Oct 2022 11:06:32 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E6DC280325; Sat, 29 Oct 2022 11:06:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1667055990; bh=iVABb+8vcvw+5NOlxhb3/8LAYDrcjeVWoHnrn0XuJuc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fQMRAapXaCANxKIkSi6VNENZeQz2eV+ytTzeYLO7cPlkQFZspQZ/c+d8fbIMYGY9x vg2IRmM5RpkiiHKTRhDCH3QQ02cC3MvAUMwoEQoi60gAEbtvN/3I8iAIv0jvvJW40t NT6vyYGbiQP1E+4HBzmpq+MU/+RKMdOgOqWxlmdAabWLIdfWbLG26+eyrlS5BAxarx jFSM0GUM9uZMuFNMlGLXeyMx53D3clizNCuhhTTbf8/PcchRIaBGm8ipGp5o78qzao 6iqgJNehkCHxo0RwSiTQBtuLN7uShRgZvUDCYctrsvA9ofY+NulkuXf/t5b1d73dz8 Yhe99m7B4FIHg== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AE0991204D7; Sat, 29 Oct 2022 11:06:30 -0400 (EDT) In-Reply-To: (lin Sun's message of "Sat, 29 Oct 2022 05:01:42 +0000") 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:246538 Archived-At: > 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. Putting expensive code in `find-file-hook` is usually a problem in itself. And like Eli, I find it risky to disable it wholesale. But the rest of code seems to call this function only if the file is not yet visited and it always tries to kill the buffer afterwards, so really this could just as well use a temp buffer and `insert-file-contents` instead. So in the end I guess the patch is OK (except for the comment, which just paraphrases the code and thus doesn't add any information). The other disabled thingies in that function are already similarly problematic :-) Stefan