From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 12:28:30 +0100 Message-ID: <87bk7yur6p.fsf@gmx.net> References: <86edcvrpzg.fsf@gnu.org> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4156"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Robert Boyer , 69480@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 01 12:30:03 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 1rg15X-0000tA-Pe for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 12:30:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg15D-0003rI-Rz; Fri, 01 Mar 2024 06:29:43 -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 1rg157-0003qu-QH for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 06:29:38 -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 1rg155-0001Qg-96 for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 06:29:36 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rg15W-0006aH-Re for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 06:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Mar 2024 11:30: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.170929254825199 (code B ref 69480); Fri, 01 Mar 2024 11:30:02 +0000 Original-Received: (at 69480) by debbugs.gnu.org; 1 Mar 2024 11:29:08 +0000 Original-Received: from localhost ([127.0.0.1]:36190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg14e-0006YN-3b for submit@debbugs.gnu.org; Fri, 01 Mar 2024 06:29:08 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:57379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg14b-0006Xn-Iq for 69480@debbugs.gnu.org; Fri, 01 Mar 2024 06:29:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1709292511; x=1709897311; i=stephen.berman@gmx.net; bh=xIHAWIN3cYGRwd3I1HBFk86/thZXdxK1PhUupSFd4Y8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=dHMpjPK63cVK93cOsx9EfMpk/3mhzjyT4+4JLMfIGYHppGW74tYUNq2SUUlC9LEZ WLVFY6V6ynMXf2LBLOLqL0FFi7vSAtamYQ0aqY49tyILLFC2lcalIv9jwH9/MHPX3 lX1N5MhqM6gqHc5nJEqgNnv8/OS1W20ComqeQ8S4FVEufnrHDCuxvmMacTaHbuhPF u8cJAL1blmwFyRpjoQbgeXEKyMGfGMsqHqFo1/vIEraN+pDseJpfB+ggneHKvmyfH naQDIB8S3wcDGLyJ/CHLeLh7L+eud0ZjSxJs/AmTLaVtLb3jE/09rQp8LXOI5BRCT VKJ/+eeyg285vnSWaw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs2 ([94.134.94.185]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1qh91G0Jq1-011Don; Fri, 01 Mar 2024 12:28:31 +0100 In-Reply-To: <86edcvrpzg.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 29 Feb 2024 22:10:27 +0200") X-Provags-ID: V03:K1:CtADf5+qX5YDRAQTT1uiFL7yQzR/ocsFw89tloeVemf0rOcGYiC 5Gv5ptaE7RP3pkjMcH91EIzwg1ViBRHJrZL1uglDryNED58zOJYFkkzARhWp0am0Tcp+CIM lFUEvLIaDP90raEFp/pebBJ+jKN+cKO27Fc8Fvm9bj7DFxeGUWAPMdwx4SRTOVeV2bPBqmA a9Ack9rscYY0NbNk8FcbQ== UI-OutboundReport: notjunk:1;M01:P0:jmNqyMtOH3g=;TwfaW5pNCehvmD2tFiVfeex0aHp 65GW2YzZx/wATAJTQMfdyIq2xKPR6OMNsKnIR5dAx2I6rIpVO9xdDE25tFJFHDSP9DiaikChE QS0O1GvjnPxPxyHdUzk71dxQLjjfPmcOr21OR2/bGGLAhzYX7nw4HxO5aUmVt3SMUlST2pP+9 ycmgmVBGhkAISDtiEYnvaPEC/hVJ1AMC5zlfOtVcQdHCuoKRIPfaqlXJid/c/bArdTfONuMR9 GFjVU+DTQdDOpDpPkeKm8kx61zuN2wGRo62uLNektXY29m/mrOz5Hxr3xCgm9oc+E4yf5e+sd CSLjTvhVPMM7RdE6gM3J04qDpW0FhbYWrmvnYe+KHtfwEU5Y9uMQ6ilgLdmU5WviOEc+WI9fa Zb+clH5CYGfZLlElTChVPbxrCgTCPclyAIq+/uLMRbk6Ljcq0jInaHTfj68Ol81H0fVRf2IwL HXR98mFDLAc+Cl7b1jJBw3hJsaPQxZA4X/DGt8ibEtLw7ZbTJDuffq8RbSH7VmUDtxjlYrGPU dT2H6SIerizeXJNWy2brhtlf2TcWZGXvM+4Wu3KWCW8JlDY8SvRTjzUIG5jjsg5g5ZaJfMtet 9p+UudqG0CTq0xxE43dIcF8B+B89eAuxIk1AS1+S2HcOXxBLasEmdkamvsw1Otz86vzZK7tAz pKPxIZ97zx33zQtW815kXS8+bLAnLz/RYFZl5KgjVnVu2HDU//t7hQTIrXpn9rlzSd50YahJT pQ49TWWgx8rnNWZCklh4Nt/s7Qc92CjtoVbO07fQfZx63tr2hYxjVhnGNdoz/etswHFysXch 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:280852 Archived-At: On Thu, 29 Feb 2024 22:10:27 +0200 Eli Zaretskii wrote: >> From: Robert Boyer >> Date: Thu, 29 Feb 2024 13:40:14 -0600 >> >> Consider this form: >> >> (progn (emacs-lisp-native-compile-and-load) (benchmark (build-sieve (ex= pt 10 >> 8)) 1)) >> >> First of all, 'benchmark' has an obvious bug because it reports a time = of >> .000005 seconds. > > You use benchmark incorrectly. And you should use benchmark-run > instead, anyway. > >> After finding the file eratosthenese.el, the evaluation of the form abo= ve >> takes 69 seconds in Emacs. >> >> After entering SBCL and loading eratosthenese.lisp, (build-sieve (expt = 10 8)) >> takes 8 seconds. > > 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? Steve Berman