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 20:36:16 +0100 Message-ID: <87jzmlu4lr.fsf@gmx.net> 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> <86h6hprjvt.fsf@gnu.org> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29592"; 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 20:36:58 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 1rg8gj-0007TP-Oi for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 20:36:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg8gO-0000Mp-CU; Fri, 01 Mar 2024 14:36: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 1rg8gM-0000MM-GQ for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 14:36: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 1rg8gM-0003D5-89 for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 14:36:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rg8gn-0005oA-WD for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 14:37: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 19:37:01 +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.170932181422307 (code B ref 69480); Fri, 01 Mar 2024 19:37:01 +0000 Original-Received: (at 69480) by debbugs.gnu.org; 1 Mar 2024 19:36:54 +0000 Original-Received: from localhost ([127.0.0.1]:37506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg8gf-0005ni-Ff for submit@debbugs.gnu.org; Fri, 01 Mar 2024 14:36:53 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:56089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rg8gd-0005nS-NV for 69480@debbugs.gnu.org; Fri, 01 Mar 2024 14:36:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1709321777; x=1709926577; i=stephen.berman@gmx.net; bh=/2kxSl3cvX84a0zCdpCWsQz5Dcl7g9P4DnMkd7aURns=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=cZQuy2gTCPuB3jY1LFHl7vYqaMnKglqEyw2tgxYiGyFwpk89Gak0HEAEMfJLIWZR ORpeT5MUm4ZsSSjvnjYwtL8IydgjdLi39vtLv/gyQuVjRh0L1hIU2YvxHqIluFtJR eZ1GkuEsH7+khOmkDgh+bphRoDrAVYVuekW+hoCzZh0E3dos/bsi1YeNQ/l2Qn6/K XhWXa27+0VaQujWlil+mAp9R6K97RyQCZIGjxx9LCLA34aU3lfGOFLA+3OzCHkbJf MWC5opUR5uZXvEq6doKpYl+ghCMG1YF8XWJ6dJ+MzCa1ylk411Bov+K23II97pKRs sdxuIdEUyN+KJFxwTw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs2 ([94.134.94.185]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQv8x-1rTqUB3zpX-00O38X; Fri, 01 Mar 2024 20:36:17 +0100 In-Reply-To: <86h6hprjvt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Mar 2024 18:34:30 +0200") X-Provags-ID: V03:K1:zBRWOEW5ToVF27e/nmqY2fhLeU0/eZMFnmrUq7mNZ0HrQ/hkIPB PU5TUStVDw9/K8tXBzf8uotM9YMAHPL/fPAxTly/VyZZjPSHQhrCiChUpAc/7/nwAzqyH+F 8nYP6UHBFT41quMC0OhWNgg+DE/imrTFTEr63K6eMGsiJijO7tpM6zcTWfaTHA0FCx3HNG/ y2AQOuHMTDFIf/5PBkhKw== UI-OutboundReport: notjunk:1;M01:P0:OGi6SDI/CgM=;VVoiYzPpoiZ5PNAKbw6tT4bmzDg r9x5dW0rgiHESjIcTC7xgr35j9s7zyKFKFevVXkIjL+1osgsFsNdRzSRlT/+mWrVQjj0dKYIh oG2MJbJf1B6qpkeOGB8346xYcjt/nY4HnOc35cNCGJtSflacA5owmsfY6mYgcX/H//XbcH9un NxqQb3DegKFxH6aD7KJgaHhV54F02T94TilX4gDTEN+2TwP019ktLxJkVjsiTD127XelIqq3P ix25YUcQ4IgIR/sbPBuDj7fJ0XqJDJDwxcHzG3ALokX85XcYVzG1HR15crCt/SW8wsKGMGoDC uiBhE1E3hVKLYUg7vzneHo6gw1Cw/juKqB/1u40RV8iKUI4gq9rRDrq5pY2XEr66h7J/3kJ+Z E1WJHjcZ3L0cFsa74yHagtss8UpXMQruYzULNsUMzoXUtSpi0Zrfb3aQNxj3KCoBdN5XGC5g4 E+cpktkpp/ASJ1Q/UoJZAqQ8kthVmgoD9oXriU3DtVcdpn0LZ/P2maIKEGFnaTsGv4Ue1x4ET p2nzH5BXFbouCAkk20FuIyO+GS2QX8UEL5f3eP9CtNNL2+6uuzZy6o1rFodBwyxCvRvsrX+k0 NA311UGA7AagGHS8VCNj13EGycT01v8jY24NBX/OdR1uS3xvrcqXCNw7u66hS6sjvAiLKrwh2 Jzoxk46ofMm5g0lCAG90mf4siHahJ8i5dWv0BNxMXq5V4MmhAXNy0fr8KInFeIpW9QT97ehCO nUx8GFobCuWQSoaDzBgm05A29Rg/UjuADewNVgG7NN1MUQCtY2KiwlCpm9Bn/QLhiXquy7Vu 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:280871 Archived-At: On Fri, 01 Mar 2024 18:34:30 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: acorallo@gnu.org, robertstephenboyer@gmail.com, 69480@debbugs.gnu.= org >> Date: Fri, 01 Mar 2024 14:53:18 +0100 >>=20 >> On Fri, 01 Mar 2024 15:41:24 +0200 Eli Zaretskii wrote: >>=20 >> >> That says almost all memory and CPU are consumed by `build-sieve': >> > >> > This is skewed, use cpu profiling instead of "memory" profiling. >>=20 >> Ah, ok. >>=20 >> >> But I don't see how that bears on the difference between native and b= yte >> >> 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. >>=20 >> Ok, I've now done that. Here's the report for the run with native >> compilation: >>=20 >> 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 >> 79 0% - comp--native-compile >> 37 0% - comp--fwprop > > Why are subroutines of native-compilation in the profile? I mistakenly used emacs-lisp-native-compile-and-load because its doc string says "Native-compile the current buffer=E2=80=99s file (if it has changed), then load it", and since it hadn't changed, I concluded (apparently wrongly) that it would just be loaded. Also, I didn't realize you can load an .eln file just like you can an .el or .elc file. Now I've done the profile after loading the .eln file and running (benchmark-run nil (build-sieve (expt 10 8))). The timing was nevertheless practical the same as before: (12.527129893 1 0.340515292) Here's the profile report: 12253 96% - command-execute 12195 96% - funcall-interactively 12193 96% - eval-expression 12193 96% - # 12193 96% - # 12187 96% - eval 12187 96% - benchmark-call 12184 96% - # 12184 96% build-sieve 3 0% - time-since 1 0% - byte-code 1 0% require 6 0% - macroexpand-all 6 0% - macroexp--expand-all 6 0% - macroexp-macroexpand 6 0% macroexpand-1 2 0% execute-extended-command 58 0% - byte-code 35 0% - read-extended-command 35 0% - read-extended-command-1 35 0% - completing-read-default 12 0% redisplay_internal (C function) 1 0% minibuffer-mode 23 0% - read--expression 8 0% redisplay_internal (C function) 2 0% - command-execute 2 0% - funcall-interactively 2 0% - yank 2 0% - current-kill 2 0% - gui-selection-value 1 0% - gui--selection-value-internal 1 0% - gui-get-selection 1 0% - gui-backend-get-selection 1 0% - apply 1 0% - # 1 0% x-get-selection-internal 1 0% - gui--set-last-clipboard-selection 1 0% - gui-backend-get-selection 1 0% - apply 1 0% - # 1 0% x-get-selection-internal 1 0% - timer-event-handler 1 0% - apply 1 0% - show-paren-function 1 0% show-paren--default 351 2% Automatic GC 26 0% redisplay_internal (C function) 21 0% + timer-event-handler 11 0% + ... Steve Berman