From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Tue, 12 Dec 2023 14:24:35 +0000 Message-ID: <87v8935wik.fsf@localhost> References: <878r919qfh.fsf@localhost> <83pm2a5k85.fsf@gnu.org> <87wmwh2tae.fsf@localhost> <83zg1d468w.fsf@gnu.org> <87bkdr2651.fsf@localhost> <87pm2584oz.fsf@localhost> <83cyy11ln1.fsf@gnu.org> <87lecp84mf.fsf@localhost> <83ttrdx8j9.fsf@gnu.org> <87a5su261p.fsf@localhost> <838r8e24yy.fsf@gnu.org> <87y1gezspg.fsf@localhost> <834jj21z05.fsf@gnu.org> <87il7izo4l.fsf@localhost> <831qe61xrh.fsf@gnu.org> <87cyxqzmhh.fsf@localhost> <83zg0uzlgw.fsf@gnu.org> <87v8bhxzcu.fsf@localhost> <83y1gdxws8.fsf@gnu.org> <87jzrwm7ul.fsf@localhost> <87h6n0m781.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35070"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 66117@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 12 15:22:06 2023 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 1rD3e8-0008j1-R4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 15:22:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD3dv-0001Ll-CJ; Tue, 12 Dec 2023 09:21:51 -0500 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 1rD3dr-0001KB-EO for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 09:21:47 -0500 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 1rD3dr-0002Aj-2J for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 09:21:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rD3e6-00069c-4F for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 09:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2023 14:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66117 X-GNU-PR-Package: emacs Original-Received: via spool by 66117-submit@debbugs.gnu.org id=B66117.170239091223642 (code B ref 66117); Tue, 12 Dec 2023 14:22:02 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 12 Dec 2023 14:21:52 +0000 Original-Received: from localhost ([127.0.0.1]:55597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD3dw-00069F-6f for submit@debbugs.gnu.org; Tue, 12 Dec 2023 09:21:52 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:44275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD3du-000691-4K for 66117@debbugs.gnu.org; Tue, 12 Dec 2023 09:21:50 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B5A73240103 for <66117@debbugs.gnu.org>; Tue, 12 Dec 2023 15:21:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702390888; bh=UasEWVWurxMirGdwTdffw6ZqlFUe77A89pjySPPVp4A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=Mz29ECW+DQl/dxyksusDLLXMFxomepJTooDVlnTWbrwGFlefwsINFncoXY7RU/GdE K7bLVqVQA9XXvfVv4DAiEXkYNAnwWkAj+7/3vxb9zuhn9ChB2BXAjlLOMv5f+Lf/MN lcs2LNGm/7JukSFyjg9LY08jPUibPchMG0o2NEmS8pvomghvl4w1QWhaiRqinnBMPz XX6b3QkcB8MlC2Du0GxulUvEGdg61W7lRlq09A3GoDdwu6/6hyOldwECv/XBDkZm8b 841p0aD9XE0IXPK4b0KlLWnElMMC4G3ISmq0HjAaZxVa8ROgSWCppimQTMfuCoBWVF KiqrcOY9WG8KQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SqLQH4WXhz6tmv; Tue, 12 Dec 2023 15:21:27 +0100 (CET) In-Reply-To: <87h6n0m781.fsf@localhost> 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:276045 Archived-At: Ihor Radchenko writes: > Ihor Radchenko writes: > >> The main contributor is set_default_internal. I _suspect_ (because we >> have non-linear scaling with the number of buffers - 3x increase in the >> number of files lead to ~6x increase in the run time) that the main >> contributor here is let-binding `case-fold-search' - special per-buffer >> variable with no default value. > > My suspicion appears to be correct - removing let-binding for > case-fold-search from `abbreviate-file-name' and > `inhibit-local-variables-p' made them disappear from the top of the > reverse call tree. > > Then, considering the ubiquity of let-binding case-fold-search across > Elisp code, speeding up let-binding of special per-buffer variables may > give us performance boost across Emacs. What do you think about introducing something like struct buffer buffer_overrides; It will be similar to buffer_defaults in buffer.c, but will hold the overriding values of buffer-local variables that are to be used instead of proper buffer-local variables. That way, we can speed up let-binding of case-fold-search. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at