From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: scratch/accurate-warning-pos: Solid progress: the branch now bootstraps. Date: Sun, 25 Nov 2018 20:15:30 +0200 Message-ID: <83y39hhvlp.fsf@gnu.org> 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> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1543169657 32191 195.159.176.226 (25 Nov 2018 18:14:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2018 18:14:17 +0000 (UTC) Cc: cpitclaudel@gmail.com, charles@aurox.ch, michael_heerdegen@web.de, emacs-devel@gnu.org, schwab@linux-m68k.org, monnier@IRO.UMontreal.CA To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 25 19:14:12 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 1gQyv5-0008EL-Vq for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2018 19:14:12 +0100 Original-Received: from localhost ([::1]:60788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQyxC-0003r8-JL for ged-emacs-devel@m.gmane.org; Sun, 25 Nov 2018 13:16:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQywS-0003r2-Eh for emacs-devel@gnu.org; Sun, 25 Nov 2018 13:15:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQywR-0002lc-NI for emacs-devel@gnu.org; Sun, 25 Nov 2018 13:15:36 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQywJ-0002as-Ms; Sun, 25 Nov 2018 13:15:27 -0500 Original-Received: from [176.228.60.248] (port=3251 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gQywJ-0003rZ-Ae; Sun, 25 Nov 2018 13:15:27 -0500 In-reply-to: <20181125175929.GE27152@ACM> (message from Alan Mackenzie on Sun, 25 Nov 2018 17:59:29 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:231357 Archived-At: > 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. > 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.