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: Sun, 30 Oct 2022 08:56:40 +0200 Message-ID: <83y1sxg5p3.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="4175"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sunlin7@yahoo.com, 58860@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 30 08:04:20 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 1op2Mk-0000sw-5X for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Oct 2022 08:04:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1op2MA-0006pw-Ms; Sun, 30 Oct 2022 03:03:42 -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 1op2Gh-0005Sl-3R for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 02:58:04 -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 1op2Gg-0000Mg-QK for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 02:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1op2Gg-0008Vs-GN for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 02:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Oct 2022 06:58: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.166711302832624 (code B ref 58860); Sun, 30 Oct 2022 06:58:02 +0000 Original-Received: (at 58860) by debbugs.gnu.org; 30 Oct 2022 06:57:08 +0000 Original-Received: from localhost ([127.0.0.1]:37209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1op2Fn-0008U8-Pw for submit@debbugs.gnu.org; Sun, 30 Oct 2022 02:57:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1op2Fm-0008Tb-0W for 58860@debbugs.gnu.org; Sun, 30 Oct 2022 02:57:07 -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 1op2Fe-0000DH-Nl; Sun, 30 Oct 2022 02:57:00 -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=bppmydSjlspjevOjR6pLCYzOxz/N1ccsqErk5j2vOK4=; b=eNjjecvy/b7B 4UpnrbyShjLfh2wlbj7jrCxFZj1Z9oAiqiagQZUtWXkOHm/BBq69nnGcNAzJseLX95PoV7MtqLq7I q2UMjnbVs/31PPCh5fuQVc+d10WPryqDx3IIlfQMnHvpsqVRf8OuHesWauHAgjDCwDy0R4CfjQs6o xcAxDmYhdV666cbuuy0RLZgYUfPDKABfsdGVFFUgshXAd/Mgt8pOuXy72oul7D+uiDi92vw0bVEU/ aNdFvfAxC4Df7BEZPJQkjdeND3uPAj+Au0l8raxNupVP2LtddLujbiMgRqTgCeFU70TOWT8j9lrp/ JFI13RF972aHo6vSYybJjA==; 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 1op2Fd-0007SO-TB; Sun, 30 Oct 2022 02:56:58 -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+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246591 Archived-At: > Cc: 58860@debbugs.gnu.org > Date: Sat, 29 Oct 2022 11:06:29 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > 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 :-) It all made sense to me, until the last paragraph: it seems to contradict the other two? You say that disabling find-file-hook is dangerous, and that the code in question could have used insert-file-contents into a temporary buffer, in which case find-file-hook would not come into play. So I assumed you'd suggest to rewrite that function to use a temporary buffer. Instead, you say that the patch is fine?.. What did I miss?