From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master df49910: Create a buffer-local binding to improve performance Date: Fri, 29 May 2020 00:34:16 -0400 Message-ID: References: <20200528233608.22610.74304@vcs0.savannah.gnu.org> <20200528233610.4778120A2C@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="81674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 29 06:35:26 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jeWjt-000L8g-CV for ged-emacs-devel@m.gmane-mx.org; Fri, 29 May 2020 06:35:25 +0200 Original-Received: from localhost ([::1]:58442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeWjs-0004c4-Ek for ged-emacs-devel@m.gmane-mx.org; Fri, 29 May 2020 00:35:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeWiy-00044Q-3K for emacs-devel@gnu.org; Fri, 29 May 2020 00:34:28 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeWiw-0002L6-GO for emacs-devel@gnu.org; Fri, 29 May 2020 00:34:27 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 85C8B1002FA; Fri, 29 May 2020 00:34:24 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4BDA41002AC; Fri, 29 May 2020 00:34:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1590726858; bh=iV5Es9sDGPcHfNqVz1QMa1L+ROdVumV1Q7NHOjNkm5k=; h=From:To:Subject:References:Date:In-Reply-To:From; b=CmN9Z+jdRpWA3ourIlEisYJAgU3uild9v/bR8Na4RX8FxS9ilndKUTBlOdc3UF3N0 ZrZHYLHQZ5C57lUvlaJ9XsuxvEkHYv3I0WpMDQUiU/pbnvQbasaGjFdfBMD2xKXEqX nqn8t9k48fdrJR/h+WuTTx4EcLr1LpEXEyP0ifh0B2x09k6jwrynOuz4jLMSGpB/df /wz5XFLk12dtTbvR9v0O+1oj8xrog1TZECGp38cOjIx/vVzHDp75FlLHC2idFyWBER rd9eSHQ+7K/03NPoL/VGoU7ht+bzkUz/FGTVE+asGMwFrScyy7meHmNls+I36nhiXn FLPVriByyDkbg== Original-Received: from alfajor (unknown [216.154.27.250]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C1A58120466; Fri, 29 May 2020 00:34:17 -0400 (EDT) In-Reply-To: <20200528233610.4778120A2C@vcs0.savannah.gnu.org> (Dmitry Gutov's message of "Thu, 28 May 2020 19:36:09 -0400 (EDT)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/29 00:34:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251604 Archived-At: > + (with-temp-buffer > + ;; Each call to ido-ignore-item-p LET-binds case-fold-search. > + ;; That is slow if there's no buffer-local binding available, > + ;; roughly O(number of buffers). This hack avoids it. Hmm... why is it implemented as a DEFVAR_PER_BUFFER? I think an even better fix is to turn it into a normal DEFVAR_LISP (together with a `make-variable-buffer-local`). After all I suspect that it's rather unusual to set it buffer-locally (it's almost always let-bound instead). Stefan