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 09:07:54 -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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7632"; 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 15:09:08 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 1rg3ZU-0001lE-4e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 15:09:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg3Yz-0007As-7P; Fri, 01 Mar 2024 09:08:37 -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 1rg3Yx-0007AB-9T for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 09:08: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 1rg3Yw-0002tB-Py for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 09:08:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rg3ZO-00059W-I9 for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 09:09: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 14:09: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.170930211819756 (code B ref 69480); Fri, 01 Mar 2024 14:09:02 +0000 Original-Received: (at 69480) by debbugs.gnu.org; 1 Mar 2024 14:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:36344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg3Yz-00058a-Er for submit@debbugs.gnu.org; Fri, 01 Mar 2024 09:08:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg3Yu-00058I-T5 for 69480@debbugs.gnu.org; Fri, 01 Mar 2024 09:08:36 -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 1rg3YN-0002cf-JF; Fri, 01 Mar 2024 09:07:59 -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=LgryqsDC+mPrhhyHZTbl/7MOA9lShzbTIXWWii6R+9g=; b=iqOKZ/P5cAilAnP1v24A mslzb+Ipk9GID2LRw8pVbou+dxwZUDzb5LxndYWu6qu99OruLUoY73GjDzvGoMEzunuX8m5K12eNa 2QYQ4z6JMYnnTqm2muwOFkHirtgVsRqlpUfgGZarbzPGwi9/qQONvvKlc1yh9f1bkQbaV9FPMRYvS gMU1jkFYHL+5vgvg7yJMGEcJVKzhm2GsfJzGWRImxT5ave9k0J/2DGSL+aCFW9hW956VbEYSANMbu ug1bbyYUcZ2rMn5e3k6w9vysEYZM7GgCrrbGKggNPmcfCFF6XRWF32sglumXvpAjbZK41wvKfS6xb muRZZWq4MiCWpA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rg3YK-0002ar-3X; Fri, 01 Mar 2024 09:07:57 -0500 In-Reply-To: <87y1b2t5wx.fsf@gmx.net> (Stephen Berman's message of "Fri, 01 Mar 2024 14:53:18 +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:280864 Archived-At: Stephen Berman writes: > On Fri, 01 Mar 2024 15:41:24 +0200 Eli Zaretskii wrote: > >>> From: Stephen Berman >>> Cc: acorallo@gnu.org, bug-gnu-emacs@gnu.org, robertstephenboyer@gmail.com, >>> 69480@debbugs.gnu.org >>> Date: Fri, 01 Mar 2024 14:07:50 +0100 >>> >>> On Fri, 01 Mar 2024 14:45:39 +0200 Eli Zaretskii wrote: >>> >>> >> It's still slower with native compilation than with byte compilation on >>> >> my machine, unlike on yours. Do you have any idea why? >>> > >>> > Maybe your system takes time to allocate memory? This program >>> > allocates almost 850MB of memory on my system, so maybe yours starts >>> > paging? >>> >>> I see a similar allocation, but I have 16 GB of RAM (~12 of which were >>> free when I ran the benchmark), so I think that shouldn't be an issue. >>> >>> > Anyway, profiling could give some hints. >>> >>> That says almost all memory and CPU are consumed by `build-sieve': >> >> This is skewed, use cpu profiling instead of "memory" profiling. > > Ah, ok. > >>> But I don't see how that bears on the difference between native and byte >>> compilation in my timings versus yours and Andrea's. >> >> 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). 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. Best Regards Andrea