From: David Engster <deng@randomsample.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, rms@gnu.org, monnier@iro.umontreal.ca
Subject: Re: Loading souce Elisp faster
Date: Tue, 26 Feb 2013 23:51:45 +0100 [thread overview]
Message-ID: <878v6a4rjy.fsf@engster.org> (raw)
In-Reply-To: <87haky4vvg.fsf@engster.org> (David Engster's message of "Tue, 26 Feb 2013 22:18:27 +0100")
David Engster writes:
> Eli Zaretskii writes:
>>> From: David Engster <deng@randomsample.de>
>>> Date: Tue, 26 Feb 2013 22:00:34 +0100
>>> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
>
>>
>>>
>>> I actually tried that, but it took *longer* with the "coding: utf-8;"
>>> comment, which is why I thought that this is apparently not working and
>>> some additional changes are needed first.
>>>
>>> Here's what I tried: I took files.el from emacs/lisp and copied it to
>>> files_utf8.el and added the "coding" comment there. Then I used this:
>>>
>>> (setq filename "~/files_utf8.el")
>>> (setq final 0)
>>> (dotimes (i 1000)
>>> (let ((res
>>> (benchmark-run (find-file filename))))
>>> (setq final (+ final (car res)))
>>> (kill-buffer (find-buffer-visiting filename))))
>>> (message "Result: %f" final)
>>>
>>> Without the coding-comment, this takes ~7.5s, but *with* the
>>> coding-comment it takes ~9.5s.
>>
>> Try "coding: utf-8-unix;" instead.
>
> This only reduces the time a tiny bit (could well be within
> variance). It's still almost 2s slower.
>
> Maybe I'm doing something stupid. I'd feel more comfortable if someone
> else could confirm this.
Well, it seems this happens because files.el is not UTF-8 encoded but
plain ASCII. If I put some multibyte characters in it and save it as
UTF-8, loading it becomes slower: it then takes ~12 seconds. If I put in
the magic utf8-comment, it stays at ~9.5s.
So unless I made some mistake, it seems that putting a "coding: utf-8"
comment into an actual UTF-8 encoded file speeds up loading, while
putting it in a plain ASCII file slows it down, both by about 20% resp.
-David
next prev parent reply other threads:[~2013-02-26 22:51 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-25 1:40 Loading souce Elisp faster Stefan Monnier
2013-02-25 1:53 ` Lennart Borgman
2013-02-25 2:53 ` Stefan Monnier
2013-02-25 2:55 ` Lennart Borgman
2013-02-25 3:57 ` Stefan Monnier
2013-02-25 4:35 ` Stephen J. Turnbull
2013-02-25 4:51 ` Stefan Monnier
2013-02-25 5:24 ` Paul Eggert
2013-02-25 6:12 ` Xue Fuqiao
2013-02-25 15:39 ` Eli Zaretskii
2013-02-25 18:41 ` Paul Eggert
2013-02-26 7:23 ` Werner LEMBERG
2013-02-26 8:48 ` Andreas Schwab
2013-02-25 5:47 ` Leo Liu
2013-02-25 16:28 ` Ted Zlatanov
2013-02-27 4:18 ` Kenichi Handa
2013-02-27 13:48 ` Stefan Monnier
2013-02-27 14:50 ` Drew Adams
2013-02-27 17:49 ` Werner LEMBERG
2013-02-27 14:28 ` Richard Stallman
2013-02-28 14:10 ` Kenichi Handa
2013-03-01 2:12 ` Richard Stallman
2013-03-02 12:52 ` Kenichi Handa
2013-03-03 0:35 ` Richard Stallman
2013-03-10 15:19 ` handa
2013-03-11 1:19 ` Richard Stallman
2013-03-15 16:20 ` handa
2013-03-20 8:15 ` Kenichi Handa
2013-02-25 7:24 ` Achim Gratz
2013-02-25 11:43 ` Richard Stallman
2013-02-25 15:19 ` Stefan Monnier
2013-02-25 15:36 ` Drew Adams
2013-02-25 16:09 ` Stefan Monnier
2013-02-25 16:31 ` Lennart Borgman
2013-02-25 18:31 ` Stefan Monnier
2013-02-25 19:20 ` Lennart Borgman
2013-02-25 20:53 ` Stefan Monnier
2013-02-25 20:57 ` Lennart Borgman
2013-02-25 21:37 ` Stefan Monnier
2013-02-25 21:57 ` Lennart Borgman
2013-02-25 23:59 ` Lennart Borgman
2013-02-26 17:27 ` Achim Gratz
2013-02-26 21:38 ` Lennart Borgman
2013-02-26 21:43 ` Dmitry Gutov
2013-02-26 21:47 ` Lennart Borgman
2013-02-26 4:54 ` Stephen J. Turnbull
2013-02-26 8:29 ` Ulrich Mueller
2013-02-25 21:51 ` Richard Stallman
2013-02-25 23:54 ` Stefan Monnier
2013-02-25 15:35 ` Drew Adams
2013-02-25 13:33 ` Kenichi Handa
2013-02-25 13:50 ` Xue Fuqiao
2013-02-25 15:35 ` Drew Adams
2013-02-25 15:52 ` Eli Zaretskii
2013-02-25 22:39 ` Xue Fuqiao
2013-02-26 3:48 ` Eli Zaretskii
2013-02-26 10:44 ` Xue Fuqiao
2013-02-26 17:02 ` Eli Zaretskii
2013-02-25 15:35 ` Drew Adams
2013-02-25 16:45 ` David Engster
2013-02-26 12:56 ` Richard Stallman
2013-02-26 16:26 ` David Engster
2013-02-26 20:19 ` Richard Stallman
2013-02-26 21:00 ` David Engster
2013-02-26 21:12 ` Eli Zaretskii
2013-02-26 21:18 ` David Engster
2013-02-26 22:40 ` Xue Fuqiao
2013-02-26 22:51 ` David Engster [this message]
2013-02-27 0:44 ` Drew Adams
2013-02-27 1:22 ` Stefan Monnier
2013-02-27 1:56 ` Lennart Borgman
2013-02-27 14:28 ` Richard Stallman
2013-02-27 15:21 ` Stefan Monnier
2013-02-27 17:21 ` Lennart Borgman
2013-02-27 18:31 ` Achim Gratz
2013-02-27 18:39 ` Drew Adams
2013-02-27 19:28 ` Achim Gratz
2013-02-27 22:32 ` Xue Fuqiao
2013-02-27 18:43 ` Lennart Borgman
2013-02-27 4:49 ` Kenichi Handa
2013-02-27 14:27 ` Richard Stallman
2013-02-26 16:57 ` Eli Zaretskii
2013-02-26 20:19 ` Richard Stallman
2013-02-26 20:45 ` Eli Zaretskii
2013-02-27 2:22 ` Stephen J. Turnbull
2013-02-25 21:12 ` Ivan Kanis
2013-02-25 22:47 ` Glenn Morris
2013-02-25 21:17 ` Barry Warsaw
2013-02-26 7:10 ` Thierry Volpiatto
2013-02-26 7:59 ` Andreas Röhler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878v6a4rjy.fsf@engster.org \
--to=deng@randomsample.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=rms@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.