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 17:44:15 +0000 Message-ID: <87msufxqmo.fsf@localhost> References: <878r919qfh.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> <87v8935wik.fsf@localhost> <83msuftr0i.fsf@gnu.org> <87plzbxtxa.fsf@localhost> <83fs07tjre.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33184"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 66117@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 12 18:42:04 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 1rD6lf-0008RB-Up for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 18:42:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD6lQ-00065d-Tj; Tue, 12 Dec 2023 12:41:48 -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 1rD6lP-00065M-HP for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 12:41: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 1rD6lO-0004kf-8g for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 12:41:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rD6ld-0000VN-NI for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 12:42:01 -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 17:42:01 +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.17024028981900 (code B ref 66117); Tue, 12 Dec 2023 17:42:01 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 12 Dec 2023 17:41:38 +0000 Original-Received: from localhost ([127.0.0.1]:57449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD6lF-0000UX-MU for submit@debbugs.gnu.org; Tue, 12 Dec 2023 12:41:38 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:54427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD6lC-0000UF-W7 for 66117@debbugs.gnu.org; Tue, 12 Dec 2023 12:41:35 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 96DAA24002A for <66117@debbugs.gnu.org>; Tue, 12 Dec 2023 18:41:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702402873; bh=q/veAK+h1+kRxIg/kL36dpeFQdZFG0qhkpxqPmLMjyo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=Yb9CEsoNpDIo77CtBXOU+7uXncUi49wgC6XNZcwX3kHckLWcplzqf5dW7RAaWxGi1 49NSfEHVa+x2pZr1Qje2dPMutenC4JhTgIaLJHa6N3oeg40j/CVoOgmQJtr0eBukp1 JIUhOFiMXSBaX2HypymGB1pSGYGJNuYRYfeVFsyN8ImMfFYegdeeC8svHnBPmEaxN5 RfYDwmhh9+V8k8BsI42tzJZQds2Fq2oP2s/dmKLfq966lJz+9cH9wGBIjCS7rHrrnS 1cT3gvdaodiQh8yqrbBLWpc0DBx6RPxfFcmWdbGBjXZfBOuzWP/Jb9sofufVKUZXDQ sPdHiaZL/Nxow== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SqQrm2vVYz6tvq; Tue, 12 Dec 2023 18:41:12 +0100 (CET) In-Reply-To: <83fs07tjre.fsf@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: , 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:276067 Archived-At: Eli Zaretskii writes: >> #define BVAR(buf, field) (buffer_overrides->field ## _ == UNSET ?\ >> (buf)->field ## _ :\ >> buffer_overrides->field ## _) >> >> and replace the loop with simply setting buffer_overrides slot. > > So for starters, we make each BVAR more expensive, i.e. make Emacs > uniformly slower (because we call BVAR all over the place). Yes, although I do not believe that it will have large impact in practice. It is just an extra == comparison. > ... And then > I'm not sure I understand how buffer_overrides will get the values of > those temporary bindings without having to use the same loops when we > have let-binding within another one. Also, what about threads? Just as any other global state variable - via `specbind'. Entering inner let will push the previous value into specpdl and recover it upon exiting. Threads work similarly, maintaining their own local specpdl queue heads that make sure that global state is recorded and rewinded as needed. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at