From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Time to merge scratch/correct-warning-pos into master, perhaps? Date: Fri, 4 Feb 2022 18:31:01 +0000 Message-ID: References: <058b682b11f58780b580@heytings.org> <83v8y8ij39.fsf@gnu.org> <6a5bb5a08b3d764611f9@heytings.org> <6a5bb5a08b6337d733c5@heytings.org> <83leyq3kfk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38510"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, mattiase@acm.org, gregory@heytings.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 04 20:58:59 2022 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 1nG4jS-0009ng-Im for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Feb 2022 20:58:58 +0100 Original-Received: from localhost ([::1]:38744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nG4jR-00043h-Dp for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Feb 2022 14:58:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG3MT-00058Y-KL for emacs-devel@gnu.org; Fri, 04 Feb 2022 13:31:09 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:23729 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1nG3MO-0002Ma-Li for emacs-devel@gnu.org; Fri, 04 Feb 2022 13:31:09 -0500 Original-Received: (qmail 10768 invoked by uid 3782); 4 Feb 2022 18:31:02 -0000 Original-Received: from acm.muc.de (p4fe1584b.dip0.t-ipconnect.de [79.225.88.75]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 04 Feb 2022 19:31:02 +0100 Original-Received: (qmail 6918 invoked by uid 1000); 4 Feb 2022 18:31:01 -0000 Content-Disposition: inline In-Reply-To: <83leyq3kfk.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:285869 Archived-At: Hello, Eli. On Fri, Feb 04, 2022 at 14:06:39 +0200, Eli Zaretskii wrote: > > Date: Fri, 4 Feb 2022 11:57:21 +0000 > > Cc: Stefan Monnier , mattiase@acm.org, > > Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org > > From: Alan Mackenzie > > Compilation _does_ do things differently. It runs with > > symbols-with-pos-enabled bound to t, which makes EQ slower than when > > that variable is nil. To see this, have a look at the defition of > > lisp_h_EQ in src/lisp.h, around line 372. > Can you explain why we need to complicate EQ so much to account for > symbols-with-pos? There are four possible ways the two Lisp objects might match - each object can be either a bare symbol, or a symbol with pos, giving four possibilities. It's worth noting that the last three possibilities are cut off completely by the check on symbols-with-pos-enabled, except during compilation. Specific questions: > . comparison of a symbol and symbol-with-pos should only compare the > symbol part, and disregard the "pos" part, right? > . if so, couldn't we implement symbol-with-pos as a struct that has > the symbol at its beginning, and then use memcmp to compare only > that part? > Or what am I missing? I don't think we can get anywhere that way. What gets compared in EQ are the Lisp_Object's, which are typically already in processor registers. I don't think we typically have a pointer to memory containing the symbol with position. Don't forget that the position attaches to the symbol OCCURRENCE, not the symbol itself. -- Alan Mackenzie (Nuremberg, Germany).