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 14:07:50 +0100 Message-ID: <8734tauml5.fsf@gmx.net> References: <86edcvrpzg.fsf@gnu.org> <87bk7yur6p.fsf@gmx.net> <877cimuo5n.fsf@gmx.net> <86msriqfws.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="1818"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: robertstephenboyer@gmail.com, 69480@debbugs.gnu.org, acorallo@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 14:08:52 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 1rg2dA-0000HU-40 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 14:08:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg2cv-0005TI-6Z; Fri, 01 Mar 2024 08: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 1rg2ct-0005Sg-2b for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 08: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 1rg2cs-0005bF-Op for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 08:08:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rg2dK-0003aT-G8 for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 08:09: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 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69480 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: robertstephenboyer@gmail.com, bug-gnu-emacs@gnu.org, acorallo@gnu.org, 69480@debbugs.gnu.org Original-Received: via spool by 69480-submit@debbugs.gnu.org id=B69480.170929850913726 (code B ref 69480); Fri, 01 Mar 2024 13:09:02 +0000 Original-Received: (at 69480) by debbugs.gnu.org; 1 Mar 2024 13:08:29 +0000 Original-Received: from localhost ([127.0.0.1]:36283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg2cm-0003ZK-UH for submit@debbugs.gnu.org; Fri, 01 Mar 2024 08:08:29 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:32773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg2ck-0003Z6-RI for 69480@debbugs.gnu.org; Fri, 01 Mar 2024 08:08:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1709298472; x=1709903272; i=stephen.berman@gmx.net; bh=omGTnUiRK+JGgJGQCI4n7pQxuR+4QyfQW2hYckRrbsM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=Fv6yaGYzlawrxVWW+poEHlGeSA5fvjIhH+R9lDrP2Qyu4iFzLxLxvYS2x/zdtM2J LdQ8gdNxG5uiF7WNYIzXLA5fUxUaHWA23gGj318IzyieTI4DP+6gHv65ZMoDgKLHA 9XloqRQjVoE7qODqyPuAuFtvJrdxMFVnFs7zGURwJgG9mHL1169VUYQM2OXO78SEz iR9qK7EweqkDrMo5fgoHMV3NbQ12TpFeJRwVxF5O6jqeKm551e1SIkaie1hFPCgMp JF0fBQ2sl0ksMSDr1Rt0yR8++Xgl00UfamWetqFM3P/NAuM4K4yWm93xf+qFEZXxW /mg6N+0LD5lmfj77pA== 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 1MAwXr-1rZCyn1BfN-00BJPe; Fri, 01 Mar 2024 14:07:52 +0100 In-Reply-To: <86msriqfws.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Mar 2024 14:45:39 +0200") X-Provags-ID: V03:K1:Xb4E9IDhBM6HJHf9muyD2awAhd2I//kwZV+04r9kFiytMy+BC8y /onoDrSvVcyy19ncDU5jY5ZzU5AHrArVVrN7RuZJLR38fDdeYxN8D/yYGFPEVPZXnlgsjlO whEkrtM5jKX3AWVc1VAkXKzoBE9W9zI4+PMx1wTmTe+YsrygrO5T7xqtFPc8obU2l80+umu hDdx/sLZeCuuC90gBRRDg== UI-OutboundReport: notjunk:1;M01:P0:DKzLwvHlnQQ=;7E5k34p4GqWtVDdtXB1FukpC+hi V6B7C0sNiHFgPNKF3mssPB5UFignEFIAzG+/9c7oMX6BvY3kOGo47yQ/G4L6deDoFCU+vH8qV 4BOOOkr+xLydapbe+NH5Jaw4+3SPfBW7qg1++9U+aPIWQ51T/d+4c02L+pC/bfi7kuxuyJYop F+zSW2yRf1ydaXXETAHOUE5nudVPn8Q5CTl1dFVGBgUYIoRLrVgwiJC6Og6K6YGSE8XWq/Yd5 2ZGd2ftmx/0rprWgAUli5wLdCFmCg3SnmvUxJRsqGzvzONhq+JsmqXljBemcgm3bzL3Ujwvrp 6uGONsFA6zANzf8S31YYtyvot1AQhFTB0Ww0+xwjJb7gOmTljKF4FcFKn6rRXWFI1dmBRsWzI G1HAfM/QMLdBSniysNPu7srhaC/sefI3rO2qPuGINfORhRshRUOUTeOV7neZjC39gEJU7FCtR d3Fg6ngnQp6tqYkCjKiBfnq8r1Pirgfh9ZxkpWCH/bLkXf5yybIo6/okHEMznz971RDhqUiBJ DSLjSxp/abAdJ1qsod0heYwU2zkNKv54T1f/qEcpX2RKndPSq8hk0FG4To+Bz6e5O5bWVuCBE 3iBGiud0W0rHEAQJpTOwZzEUASNxzQj1uSbyUOMHDZwzb/6+os3qitYnJ+jG9fbty+dSegaxA UNdKBB8C956qSuqC8SzADIwxg6i1r18OuDIRNPiHmtyEHJZeu6KgJDMhJyrj9/wOkjSxSnu/j aSxjbuTUoPFBG2v1FXBmc1PvCJ7rRGt/5POWpiqlYTsPCIKZieuep8MB+fyLDtVXygJFwVfq 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:280861 Archived-At: On Fri, 01 Mar 2024 14:45:39 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife= of >> text editors" , Eli Zaretskii , >> Robert Boyer , 69480@debbugs.gnu.org >> Date: Fri, 01 Mar 2024 13:33:56 +0100 >> >> On Fri, 01 Mar 2024 07:18:29 -0500 Andrea Corallo wr= ote: >> >> >> Why is the timing with native compilation so much slower than with b= yte >> >> compilation? >> > >> > Because the file is not lexically scoped so we are not running >> > optimizations. >> >> Ah, ok. >> >> > On my laptop I see: >> > >> > 11 secs byte compiled >> > 18 secs native compiled >> > >> > 7 secs byte compiled with lexical scope >> > 5 secs native compiled with lexical scope. >> >> I got these timings with lexical scope: >> >> native compiled: (12.717023709000001 1 0.34653286699999997) >> byte compiled: (9.597325325 1 0.38987931) >> >> 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': 807,918,497 99% - command-execute 806,047,846 99% - funcall-interactively 804,440,179 99% - eval-expression 804,440,179 99% - # 804,440,179 99% - # 804,440,179 99% - eval 804,440,179 99% - progn 800,000,184 99% - benchmark-call 800,000,104 99% - # 800,000,104 99% - build-sieve 40 0% expt 80 0% time-since 4,439,995 0% + emacs-lisp-native-compile-and-load 1,607,667 0% + execute-extended-command 1,870,651 0% + byte-code 99,848 0% + redisplay_internal (C function) 1,729 0% Automatic GC 1,416 0% + timer-event-handler 1,180 0% + ... But I don't see how that bears on the difference between native and byte compilation in my timings versus yours and Andrea's. Steve Berman