From: Robert Thorpe <rt@robertthorpeconsulting.com>
To: Emanuel Berg <embe8573@student.uu.se>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Emacs benchmark workload to run and time instead of hunch performance
Date: Wed, 09 Jul 2014 12:24:06 +0100 [thread overview]
Message-ID: <87vbr66ai1.fsf@robertthorpeconsulting.com> (raw)
In-Reply-To: <87ha2r1l9r.fsf@debian.uxu> (message from Emanuel Berg on Wed, 09 Jul 2014 01:30:24 +0200)
Emanuel Berg <embe8573@student.uu.se> writes:
> Emanuel Berg <embe8573@student.uu.se> did write:
...
> Not-very-ambitious workload but still:
>
> (defun bench ()
> (interactive)
> (define-abbrev global-abbrev-table "rsb" "rec.sport.boxing")
> (insert "rsb")
> (expand-abbrev)
>
> (insert " 3")
> (backward-char 3)
> (delete-char 2)
>
> (buffer-menu)
>
> (man "ls")
>
> (beginning-of-buffer) )
>
> (progn
> (elp-instrument-function 'bench)
> (bench)
> (elp-results) )
>
> Execution times for first invocation:
>
> emacs -Q:
>
> bench 1 0.038667778 0.038667778
>
> emacs, with tons of configuration:
>
> bench 1 0.05604648 0.05604648
I get ~0.028 for emacs -Q and ~0.03 using my init file.
> Keep calling it I guess it ends up in a cache because
> it gets much faster - but the emacs -Q is still faster.
That's not the reason.
Do (elp-instrument-function 'man). It'll tell you that for the
single-run case much of the time is spent in (man "ls"). The Emacs
"man" command works by calling the system man command which typesets the
man page from it's troff source then pipes it to Emacs. The Emacs man
command first checks if the man page is already open in a buffer, if so
it just switches to that buffer. So, on the first interation of your
benchmark you have the system man program performing typesetting, then
on each later iteration it does nothing. To make the benchmark fair you
have to kill the man buffer before each run.
Of course cache effects still make the benchmark quicker for repeated
runs. That's partly because of the processor's cache, but also because
Linux's file-system cache will store the man page's source file. (It
goes below 0.01 for me).
> So the next question is just what configs slows it down
> - if there is indeed a difference there...
I don't know. Try dividing you init file into two halves. See if the
first half or the second half causes the slowdown. When you've found
which half it is divide that into halves too, and so on until you've
found the culprit.
BR,
Robert Thorpe
next prev parent reply other threads:[~2014-07-09 11:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 1:10 Emacs benchmark workload to run and time instead of hunch performance Emanuel Berg
[not found] ` <CAAjq1mfg4LtRxfrZ-dy-4jdZX-YfbVfgm-Hqho+4ODQNga3BBw@mail.gmail.com>
2014-07-08 15:18 ` Emanuel Berg
2014-07-08 22:58 ` Emanuel Berg
2014-07-08 23:30 ` Emanuel Berg
2014-07-09 11:24 ` Robert Thorpe [this message]
[not found] <mailman.5118.1404905070.1147.help-gnu-emacs@gnu.org>
2014-07-09 17:03 ` Emanuel Berg
2014-07-09 22:37 ` Stefan Monnier
[not found] ` <mailman.5153.1404945461.1147.help-gnu-emacs@gnu.org>
2014-07-09 23:16 ` Emanuel Berg
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=87vbr66ai1.fsf@robertthorpeconsulting.com \
--to=rt@robertthorpeconsulting.com \
--cc=embe8573@student.uu.se \
--cc=help-gnu-emacs@gnu.org \
/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.
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).