unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: robertstephenboyer@gmail.com, 69480@debbugs.gnu.org, acorallo@gnu.org
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	[thread overview]
Message-ID: <87jzmlu4lr.fsf@gmx.net> (raw)
In-Reply-To: <86h6hprjvt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Mar 2024 18:34:30 +0200")

On Fri, 01 Mar 2024 18:34:30 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: acorallo@gnu.org,  robertstephenboyer@gmail.com,  69480@debbugs.gnu.org
>> Date: Fri, 01 Mar 2024 14:53:18 +0100
>> 
>> On Fri, 01 Mar 2024 15:41:24 +0200 Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>> >> 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%    - #<compiled -0x5db3e1955cb81d1>
>>        12485  95%     - #<compiled -0x8a5cf032951a0fe>
>>        12480  95%      - eval
>>        12480  95%       - progn
>>        12367  94%        - benchmark-call
>>        12367  94%         - #<lambda 0x8c97b8cb7bd82>
>>        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’s 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%    - #<compiled -0x5db3e1955cb81d1>
       12193  96%     - #<compiled 0xfed2db7b0724d71>
       12187  96%      - eval
       12187  96%       - benchmark-call
       12184  96%        - #<lambda 0x833a720aa0822>
       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%             - #<compiled 0xb78982bfc8d3cfc>
           1   0%                x-get-selection-internal
           1   0%         - gui--set-last-clipboard-selection
           1   0%          - gui-backend-get-selection
           1   0%           - apply
           1   0%            - #<compiled 0xb78982bfc8d3cfc>
           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





  reply	other threads:[~2024-03-01 19:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 19:40 bug#69480: Emacs Lisp needs, for its great 'native-compile', 'declare' and 'the' for fixnums and arrays Robert Boyer
2024-02-29 20:10 ` Eli Zaretskii
2024-02-29 20:54   ` Robert Boyer
2024-02-29 22:10     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01  6:45     ` Eli Zaretskii
2024-02-29 21:04   ` Robert Boyer
2024-03-01 11:28   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 12:18     ` Andrea Corallo
2024-03-01 12:33       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 12:45         ` Eli Zaretskii
2024-03-01 13:07           ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 13:41             ` Eli Zaretskii
2024-03-01 13:53               ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 14:07                 ` Andrea Corallo
2024-03-01 14:35                   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 16:10                     ` Andrea Corallo
2024-03-01 19:36                       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 16:34                 ` Eli Zaretskii
2024-03-01 19:36                   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-01 12:40       ` Eli Zaretskii
2024-03-01 12:34     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzmlu4lr.fsf@gmx.net \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69480@debbugs.gnu.org \
    --cc=acorallo@gnu.org \
    --cc=eliz@gnu.org \
    --cc=robertstephenboyer@gmail.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).