From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: scratch/accurate-warning-pos: Solid progress: the branch now bootstraps. Date: Sun, 25 Nov 2018 18:23:30 +0000 Message-ID: <20181125182330.GG27152@ACM> References: <20181117124534.GA8831@ACM> <83muq7u9rk.fsf@gnu.org> <20181123130904.GA2916@ACM> <20181125143125.GA27152@ACM> <87y39h6vie.fsf@igel.home> <20181125154203.GB27152@ACM> <838t1hjejt.fsf@gnu.org> <20181125175929.GE27152@ACM> <83y39hhvlp.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1543170322 22734 195.159.176.226 (25 Nov 2018 18:25:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2018 18:25:22 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: cpitclaudel@gmail.com, charles@aurox.ch, michael_heerdegen@web.de, emacs-devel@gnu.org, schwab@linux-m68k.org, monnier@IRO.UMontreal.CA To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 25 19:25:17 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQz5p-0005og-RP for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2018 19:25:17 +0100 Original-Received: from localhost ([::1]:60826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQz7w-0008AK-86 for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2018 13:27:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQz7L-0008A9-Ex for emacs-devel@gnu.org; Sun, 25 Nov 2018 13:26:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQz7I-0001S6-Am for emacs-devel@gnu.org; Sun, 25 Nov 2018 13:26:51 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:31428 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gQz7I-0001Rh-0g for emacs-devel@gnu.org; Sun, 25 Nov 2018 13:26:48 -0500 Original-Received: (qmail 35396 invoked by uid 3782); 25 Nov 2018 18:26:47 -0000 Original-Received: from acm.muc.de (p2E5D5C08.dip0.t-ipconnect.de [46.93.92.8]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 25 Nov 2018 19:26:46 +0100 Original-Received: (qmail 27800 invoked by uid 1000); 25 Nov 2018 18:23:30 -0000 Content-Disposition: inline In-Reply-To: <83y39hhvlp.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231360 Archived-At: Hello, Eli. On Sun, Nov 25, 2018 at 20:15:30 +0200, Eli Zaretskii wrote: > > Date: Sun, 25 Nov 2018 17:59:29 +0000 > > From: Alan Mackenzie > > Cc: cpitclaudel@gmail.com, charles@aurox.ch, michael_heerdegen@web.de, > > emacs-devel@gnu.org, schwab@linux-m68k.org, monnier@IRO.UMontreal.CA > > > > The idea behind symbols-with-pos-enabled is that it will be a 32/64 bit > > > > integer permanently in cache, hence can be tested for zero/non-zero > > > > rapidly. > > > This is premature optimization, we have gazillions of such tests in > > > our inner loops (e.g., see bidi.c), one more or one less shouldn't > > > matter. > > It's a straightforward way of writing it, without using any contorted > > code, so even if it is optimisation, it's harmless optimisation. > The premature optimisation here is to worry about performance without > timing the code. > > But right from the beginning of the exercise, I've had speed at the back > > of my mind. If the slowdown had been 30%, the Emacs project leadership > > would have been very unhappy about the idea. > As I said, I'd be very surprised if using DEFVAR_BOOL would slow down > what you did in any significant way, beyond the slowdown due to the > comparison and struct member access. I'll time it, then we'll know. > > My current trouble arises from the need to access the variable both from > > C and from Lisp. > DEFVAR_BOOL defines a variable accessible both from C and Lisp. > > I'm still a little confused as to what a DEFVAR_BOOL is. > It's a C 'bool'. Look at defvar_bool the function: its last argument > is a pointer to the C counterpart of a DEFVAR_BOOL. > You can also use ptype in the debugger to see what it really is, if > you want to be absolutely sure. OK, thanks for the explanation. I'll change the declaration of that variable (and another one) to DEFVAR_BOOL, and tidy up lisp.h to match. Then I'll time the resulting Emacs again. :-) -- Alan Mackenzie (Nuremberg, Germany).