From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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 14:34:36 +0200 Message-ID: <86plweqgf7.fsf@gnu.org> References: <86edcvrpzg.fsf@gnu.org> <87bk7yur6p.fsf@gmx.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: robertstephenboyer@gmail.com, 69480@debbugs.gnu.org To: Stephen Berman , Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 01 13:35:47 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 1rg279-0007OL-AF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 13:35:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg26y-0004rA-Ew; Fri, 01 Mar 2024 07:35: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 1rg26w-0004qx-Ru for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 07:35:34 -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 1rg26w-0007VR-Jj for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 07:35:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rg27O-0002gT-AP for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 07:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Mar 2024 12:36: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.170929652210259 (code B ref 69480); Fri, 01 Mar 2024 12:36:02 +0000 Original-Received: (at 69480) by debbugs.gnu.org; 1 Mar 2024 12:35:22 +0000 Original-Received: from localhost ([127.0.0.1]:36250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg26j-0002fO-MQ for submit@debbugs.gnu.org; Fri, 01 Mar 2024 07:35:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg26h-0002fA-8S for 69480@debbugs.gnu.org; Fri, 01 Mar 2024 07:35:21 -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 1rg26A-0007Dj-5I; Fri, 01 Mar 2024 07:34:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=L9Ee+gSAH8hOt1Bc3nF73T+kUih1ctTG/Gv4mZa7iJY=; b=mXPX9h3bi5y5 5FeRGK5LG7AaiDSM7kDHRC/i4dSiRzIiIy8hxYUlo4mDgUfKh43v87yppdhyX29stbqXDuom+BG8b M3YwULuDTFgqwVs4NOSzU2Y049NNV2j/iubq0Oce4gNnl45OS9MxJC00/Zdnm5K620cqqcEFgqYO6 oZfobSQ/2bbVFjFyIq17TrHRTjXO4n52OrBk37+NlHRWt0tdhRKa2OYXwmOq0bsKJAu/gaK1DZv0J PifLWzERu1mDEAw/D6ILkRvcQFDeSh7r6gTug3NbK3RzKCwfzS4SX43vfcOASlYDcRXZPcTCBFJVr IoBo1ZdmbYlTj36+rDhnHQ==; In-Reply-To: <87bk7yur6p.fsf@gmx.net> (message from Stephen Berman on Fri, 01 Mar 2024 12:28:30 +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:280858 Archived-At: > From: Stephen Berman > Cc: Robert Boyer , 69480@debbugs.gnu.org > Date: Fri, 01 Mar 2024 12:28:30 +0100 > > On Thu, 29 Feb 2024 22:10:27 +0200 Eli Zaretskii wrote: > > > It takes 16.7 sec on my system. > > I was curious to see how long it takes on my system, compared to the > byte-compiled and uncompiled files, and the results surprised me. > First, I visited the file eratosthenes.el, ran `eval-buffer' and then > `M-: (benchmark-run nil (build-sieve (expt 10 8)))', with this result: > > (143.326808051 1 0.344846223) > > Then I ran `M-: (progn (emacs-lisp-native-compile-and-load) > (benchmark-run nil (build-sieve (expt 10 8))))', with this result: > > (37.457440511 1 0.36922945500000004) > > The native compilation also produced a byte-compiled file > eratosthenes.elc, so I then loaded that file and again ran `M-: > (benchmark-run nil (build-sieve (expt 10 8)))', with this result: > > (21.854069551000002 1 0.3595161699999999) > > I was surprised that this was much faster than the run with native > compilation, but I thought perhaps this was due to the time spent > producing both the native and byte-compiled files (though more than 15 > seconds for that seemed unlikely), so I ran `M-: (progn > (emacs-lisp-native-compile-and-load) (benchmark-run nil (build-sieve > (expt 10 8))))' again, which just loaded the already native-compiled > file (and updated its timestamp), but the result was practically the > same as the first time: > > (37.095767574 1 0.36986937500000017) > > Why is the timing with native compilation so much slower than with byte > compilation? That's not what I see here (in an optimized build of Emacs 29.2). On my system, the byte-compiled version and the native-compiled version yield almost the same times: 16.12 vs 16.5 sec. The way native compilation is currently implemented, whether it produces a significant speedup depends on the actual Lisp code, and having the same or even slightly slower performance is not unheard of. So I don't see anything unexpected on my system, at least in Emacs 29. Adding Andrea, in case he has comments to this.