From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#69480: Emacs Lisp needs, for its great 'native-compile', 'declare' and 'the' for fixnums and arrays. Date: Fri, 01 Mar 2024 11:10:21 -0500 Message-ID: References: <86edcvrpzg.fsf@gnu.org> <87bk7yur6p.fsf@gmx.net> <877cimuo5n.fsf@gmx.net> <86msriqfws.fsf@gnu.org> <8734tauml5.fsf@gmx.net> <86jzmmqdbv.fsf@gnu.org> <87y1b2t5wx.fsf@gmx.net> <87ttlqt3z6.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14885"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: robertstephenboyer@gmail.com, Eli Zaretskii , 69480@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 01 17:11:56 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rg5UJ-0003eM-E6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 17:11:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg5U0-0007gU-UK; Fri, 01 Mar 2024 11:11:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rg5Ty-0007g9-UC for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 11:11:35 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rg5Ty-0000xc-GK for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 11:11:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rg5UQ-0000JS-1q for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 11:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Mar 2024 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69480 X-GNU-PR-Package: emacs Original-Received: via spool by 69480-submit@debbugs.gnu.org id=B69480.17093094641120 (code B ref 69480); Fri, 01 Mar 2024 16:12:02 +0000 Original-Received: (at 69480) by debbugs.gnu.org; 1 Mar 2024 16:11:04 +0000 Original-Received: from localhost ([127.0.0.1]:37319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg5TT-0000I0-Gb for submit@debbugs.gnu.org; Fri, 01 Mar 2024 11:11:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg5TO-0000HR-LK for 69480@debbugs.gnu.org; Fri, 01 Mar 2024 11:11:02 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rg5Sq-0000pr-Ld; Fri, 01 Mar 2024 11:10:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=UiWyD5tyx3lIox13CIF6SFCBEWpvrlZikhg/8bQIziY=; b=fvl0AXs7yMuzoWQdBB4W yfxTBmBJ15fkH0iZDzTKyY43roXkZV7SV0MIDJqfJTWU23TQ2kBFCFfaR7g3ziWyoPvcVsCJ3N67I EH8HyMS6lh3yzsytuEejZmTLqhlLo8nT3pw8afWF1AxnxZTXjdUEo/qWDjSbe02eM5tRY8NA8EjdS eYtfkgsbOzan2Ho7EhCA+oZIaoju1zlPDrBl58jCTjOaheUi1Dip2i16759pp3ORveuxv/MTkxo8C 37ZZINdTcy8+TTErVQIDGxfZ1xqqIVg7ybFJ48w8CkIOcpcuS2kzZvWjhyZpHm7D4lD20vhUlk9XZ 9vj73MyEgr6eqA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rg5Sn-0000A3-Hf; Fri, 01 Mar 2024 11:10:23 -0500 In-Reply-To: <87ttlqt3z6.fsf@gmx.net> (Stephen Berman's message of "Fri, 01 Mar 2024 15:35:09 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280866 Archived-At: Stephen Berman writes: > On Fri, 01 Mar 2024 09:07:54 -0500 Andrea Corallo wrote: > >> Stephen Berman writes: >> >>> On Fri, 01 Mar 2024 15:41:24 +0200 Eli Zaretskii wrote: >>> > [...] >>>> My suggestion was to compare profiles in the byte-compiled and >>>> native-compiled cases. >>>> >>>> Btw, are you running both cases in the same session? If so, don't: >>>> restart Emacs and run the other case instead. >>> >>> Ok, I've now done that. Here's the report for the run with native >>> compilation: >>> >>> 12599 95% - command-execute >>> 12487 95% - funcall-interactively >>> 12486 95% - eval-expression >>> 12485 95% - # >>> 12485 95% - # >>> 12480 95% - eval >>> 12480 95% - progn >>> 12367 94% - benchmark-call >>> 12367 94% - # >>> 12367 94% build-sieve >>> 113 0% - emacs-lisp-native-compile-and-load >>> 113 0% - emacs-lisp-native-compile >>> 113 0% - native-compile >> >> IIUC this is profiling the native compilation itself. >> >> BTW I'd suggest the profile is done with perf (and running batch). > > I don't have perf installed, but I build the kernel from source, so I > guess I could build and install perf, but... > >> Given you see on your machine similar times for native and byte compiled >> the expected outcome should be tha tthe time is spent in some C routine >> of our core. > > If you consider ~12.7 (native-compiled) and ~9.6 (byte-compiled), > similar for this benchmark, and since Eli said it's expected that > native-compiled elisp can be slower than byte-compiled elisp for some > programs, then I guess I can just accept that for this case, the > difference between my timings is within a reasonable margin of error and > not due to some problem with my libgccjit (which I also built and > installed myself). I doubt the correctness of your measure. Some points: 1- Your benchmark results shows you are measuring the compilation process as well. 2- As Eli mentioned you should always start from on a freshly started session (probably running batch). 3- You should also do several measures of the same test to estimate the noise and, as consequence, the accuracy of your measure. The reason is that there are many sources of noise on a running system (OS, paging, CPU throttle due to thermal conditions etc...). These sources of noise can have a big impact. Measuring performance in reliable way is more tricky than what most people think :) Thanks Andrea