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 19:33:28 +0000 Message-ID: References: <6a5bb5a08b3d764611f9@heytings.org> <6a5bb5a08b6337d733c5@heytings.org> <83leyq3kfk.fsf@gnu.org> <83a6f631k3.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="29313"; 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 21:04:47 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 1nG4p4-0007PF-9V for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Feb 2022 21:04:46 +0100 Original-Received: from localhost ([::1]:43602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nG4p2-0007Wm-Q7 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Feb 2022 15:04:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nG4L1-0004VH-AA for emacs-devel@gnu.org; Fri, 04 Feb 2022 14:33:44 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:27932 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1nG4Kx-0003Vh-Q9 for emacs-devel@gnu.org; Fri, 04 Feb 2022 14:33:42 -0500 Original-Received: (qmail 51695 invoked by uid 3782); 4 Feb 2022 19:33:29 -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 20:33:28 +0100 Original-Received: (qmail 7079 invoked by uid 1000); 4 Feb 2022 19:33:28 -0000 Content-Disposition: inline In-Reply-To: <83a6f631k3.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:285870 Archived-At: Hello, Eli. On Fri, Feb 04, 2022 at 20:54:20 +0200, Eli Zaretskii wrote: > > Date: Fri, 4 Feb 2022 18:31:01 +0000 > > Cc: gregory@heytings.org, monnier@iro.umontreal.ca, mattiase@acm.org, > > larsi@gnus.org, emacs-devel@gnu.org > > From: Alan Mackenzie > > > 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. > I don't see how the number of combinations is relevant. If all you > need to compare is the symbol part, then whether there's something > after it in memory is not interesting and doesn't affect comparison. Yes, that's true. > > Specific questions: > > > . comparison of a symbol and symbol-with-pos should only compare the > > > symbol part, and disregard the "pos" part, right? Yes. > > > . 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. > Sorry, I don't understand how this answers my questions. OK, I don't think we can improve the performance by the use of a struct containing the symbol followed by the position. I'm not sure what more I can add. > > Don't forget that the position attaches to the symbol OCCURRENCE, > > not the symbol itself. > I don't understand what I need not to forget, please elaborate. In the moderate past, that thing, the (lack of) possibility of attaching the position to the symbol, caused me a lack of clarity. I forgot many times that we need to deal with symbol occurrences, not symbols. We cannot extend struct Lisp_Symbol with the position, since a single symbol typically occurs several times in different positions. Rather, I think we would need to extend the Lisp_Object in this fashion. > What is there in a symbol-with-pos except the symbol and the position? There is the symbol, the position, and a pseudovector header. > (And please be more cooperative and forthcoming, since my questions > are meant to help make this feature less expensive, otherwise there's > a real chance of the feature to be removed, something I hope you don't > want.) Sorry, I was doing my best to answer what I thought you were asking. I wasn't trying to be evasive. -- Alan Mackenzie (Nuremberg, Germany).