From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Correct line/column numbers in byte compiler messages Date: Sun, 22 Mar 2020 11:26:19 +0000 Message-ID: <20200322112619.GA32470@ACM> References: <20200319203449.GA4180@ACM> <20200320191846.GA5255@ACM> <20200321153041.GA7805@ACM> <20200321201954.GB7805@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="125382"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Rocky Bernstein , Stefan Monnier , emacs-devel To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 22 12:26:59 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 1jFykt-000WV1-JS for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 12:26:59 +0100 Original-Received: from localhost ([::1]:45276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFyks-0001hP-L8 for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Mar 2020 07:26:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40665) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFykN-00015r-Sv for emacs-devel@gnu.org; Sun, 22 Mar 2020 07:26:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFykM-0003vB-B3 for emacs-devel@gnu.org; Sun, 22 Mar 2020 07:26:27 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:50299 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jFykL-0003uZ-F5 for emacs-devel@gnu.org; Sun, 22 Mar 2020 07:26:25 -0400 Original-Received: (qmail 86109 invoked by uid 3782); 22 Mar 2020 11:26:23 -0000 Original-Received: from acm.muc.de (p4FE15B21.dip0.t-ipconnect.de [79.225.91.33]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 22 Mar 2020 12:26:19 +0100 Original-Received: (qmail 28304 invoked by uid 1000); 22 Mar 2020 11:26:19 -0000 Content-Disposition: inline In-Reply-To: <20200321201954.GB7805@ACM> 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.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:245663 Archived-At: Hello, Andrea. On Sat, Mar 21, 2020 at 20:19:54 +0000, Alan Mackenzie wrote: > On Sat, Mar 21, 2020 at 18:37:13 +0000, Andrea Corallo wrote: > > Have to apologize this is probably the quarantine effect .... > As of today, we're under quarantine, too. :-( > > .... but I couldn't resist testing this: > > #+BEGIN_SRC lisp > > ;; -*- lexical-binding: t; -*- > > (require 'cl-lib) > > (defvar elb-list (cl-loop for i from 0 to 1500000 > > if (cl-oddp i) > > collect 'a > > else > > collect 'b)) > > (defun elb-eq () > > (let ((n 0)) > > (dolist (l elb-list n) > > (when (eq 'b l) > > (cl-incf n))))) > > (defun elb-eq-entry () > > (dotimes (_ 1000) > > (elb-eq))) > > #+END_SRC > > Results: > > b619777dd6 (baseline) 50.09s > > accurate-warning-pos 51.28s > > This is about 2% perf penalty. > On my Ryzen, I'm seeing a 50% penalty. :-( (Admittedly that's > comparing the year old branch to current master. I suppose I should > build the correct comparable revision and try again.) This suggests > that the branch prediction logic isn't present (or isn't active) on the > Ryzen. OK, I've done just that (with revision b619777dd67e271d639c6fb1d031650af8fd79e6 from 2019-03-30) and I now see what you see: b619777: 76.067s scratch/accurate-warning-pos: 77.656s. master: 52.423s So, clearly, optimisations to Emacs in the last year have borne fruit. Maybe that optimisaton would be useful in s/a-w-p. > > Interestingly with the __builtin_expect trick applied exec time gets > > back to 50.65s. > How do you do this? I couldn't make much sense of the documentation of > __builtin_expect. :-( I've read your patch in your other mail, and I will apply it and try it out. [ .... ] > > Regards > > Andrea > > -- > > akrl@sdf.org -- Alan Mackenzie (Nuremberg, Germany).