From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH v2 00/16] Speeding up DEFVAR_PER_BUFFER Date: Tue, 01 Dec 2020 11:01:12 -0500 Message-ID: References: <20201119153814.17541-1-sbaugh@catern.com> <837dqdxtea.fsf@gnu.org> <87a6v9jqz8.fsf@catern.com> <83y2itwbzk.fsf@gnu.org> <87ft4shxg8.fsf@catern.com> <835z5mk84w.fsf@gnu.org> <87y2iihafg.fsf@catern.com> <83r1o9imtb.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="30349"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Spencer Baugh , arnold@tdrhq.com, dgutov@yandex.ru, rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 01 17:04:25 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 1kk88e-0007lZ-W4 for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 17:04:24 +0100 Original-Received: from localhost ([::1]:37282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk88e-00028e-0V for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Dec 2020 11:04:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk85k-00076t-6h for emacs-devel@gnu.org; Tue, 01 Dec 2020 11:01:24 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk85d-0000r3-A7; Tue, 01 Dec 2020 11:01:23 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 73F9944093E; Tue, 1 Dec 2020 11:01:15 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F36964408E8; Tue, 1 Dec 2020 11:01:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1606838474; bh=UV+EMG9O8cSyjv3MpRkBDbtLuOgyO2+Mq8aR6Rz8ekc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SA8EJYr/kJHb/oJj52z8EENdJ4vANLDAhR0HWu9LxiIbo0YNVEc6TkGUKnyNYk+6n gfIQsM/pbKCsdSuR6tSEmnVsYTH7qJFkTE8uofZldv1kmM7ULVRZmuDBlWwStyviTv Pai80Qvx+7xlkPJdRKfPKTtpB1MTayLD5HMd1RJ1wAs/q8C8lSOtIe5Bybr3RQDP9T /J5aVblFFb+9xzUdC7QuhfXtAsBTIX3TyumV/KIB82OihBqKymWa/5tUYchonZokxV 3lvAj4K5SC0keXYDE7l4ntTmT6mOL+9ev0mrGaPKHJybrbq7z1UrqSIi9JGvWrV6Jf TTBBG459n1+kQ== Original-Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A1D02120323; Tue, 1 Dec 2020 11:01:13 -0500 (EST) In-Reply-To: <83r1o9imtb.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 01 Dec 2020 17:10:56 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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:260131 Archived-At: > So in effect we make every access to built-in buffer-local variables > pay for the single use case when the let-binding is done in a buffer > that has no local value. Yup, increase the average time taken in order to avoid the "pathological" worst case. BTW, for the original problem (i.e. let-binding case-fold-search in a buffer that doesn't have a buffer-local setting of that variable), we could attack the problem in a different way: 1- change `case-fold-search` to a plain DEFVAR_LISP instead of a PER_BUFFER. 2- change its `let-binding` rule so it automatically becomes buffer-local within the `let` (i.e. the let-binding stops affecting other buffers). Stefan