From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Correct line/column numbers in byte compiler messages Date: Sat, 21 Mar 2020 16:28:55 +0000 Message-ID: References: <20200319203449.GA4180@ACM> <20200320191846.GA5255@ACM> <20200321153041.GA7805@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="65972"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Rocky Bernstein , Stefan Monnier , emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 21 17:29:38 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 1jFh0E-000H35-84 for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Mar 2020 17:29:38 +0100 Original-Received: from localhost ([::1]:38884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFh0D-0003TZ-B1 for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Mar 2020 12:29:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFgza-00034y-Pf for emacs-devel@gnu.org; Sat, 21 Mar 2020 12:28:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFgzZ-0003xx-Ll for emacs-devel@gnu.org; Sat, 21 Mar 2020 12:28:58 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:51781) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jFgzZ-0003wo-Eh; Sat, 21 Mar 2020 12:28:57 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 02LGSt4m023408 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sat, 21 Mar 2020 16:28:55 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 02LGStrP013516; Sat, 21 Mar 2020 16:28:55 GMT In-Reply-To: <20200321153041.GA7805@ACM> (Alan Mackenzie's message of "Sat, 21 Mar 2020 15:30:41 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 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:245632 Archived-At: Alan Mackenzie writes: > Hello, Andrea. > > On Sat, Mar 21, 2020 at 11:22:03 +0000, Andrea Corallo wrote: >> The outcome as I see it is that total bootstrap time gets bigger 1.1x >> while normal runtime appears not affected. > > Well, it looks like the normal runtime is around 2.x% slower for > scratch/accurate-warning-pos. Well I studied physics so for me 2% is pretty much zero :) :) Joking apart I'm not sure this is really sufficient to conclude is noise or not. >> For my quick understanding of how it works this is expected. The >> additional branch and compare against symbols_with_pos_enabled in `eq' >> is a kind of branch that is very easily predictable by any modern CPU, >> therefore when the feature is off (not compiling) it becomes transparent >> (I'd see a compiler branch hit there too). > > In other words, the processor will test symbols_with_pos_enabled > simultaneously with starting the continuation for the "not" case. The processor will just speculate guessing the target branch without having to wait for symbols_with_pos_enabled value to be loaded. Given this change rarely, speculation there should be pretty much always correct. I'd wrap symbols_with_pos_enabled into something like: #define SYMBOLS_WITH_POS_ENABLED \ __builtin_expect(symbols_with_pos_enabled, 0) To make sure we minimize instruction cache overhead too. > This extra test in the EQ code was always the main thing in the slowdown > occurring in this git branch. Is the EQ overhead the main/only one? Also GC seems marginally affected. I think would be interesting to write a nano benchmark EQ focused to test this accurately. > When I timed things back in 2018, I got a slowdown of somewhat more than > 2.x%. May I ask what sort of processor you're using? Mine (unchanged > since then) is an AMD Ryzen. I did the test on a "Xeon E5-1660 v3". I think we can classify it as a good system from few (6?) years ago. Not very fast by today's standards but still quite beefy in terms of caches. Bests Andrea -- akrl@sdf.org