[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Loading souce Elisp faster
From: |
David Engster |
Subject: |
Re: Loading souce Elisp faster |
Date: |
Tue, 26 Feb 2013 23:51:45 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.93 (gnu/linux) |
David Engster writes:
> Eli Zaretskii writes:
>>> From: David Engster <address@hidden>
>>> Date: Tue, 26 Feb 2013 22:00:34 +0100
>>> Cc: address@hidden, address@hidden
>
>>
>>>
>>> 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
- Re: Loading souce Elisp faster, (continued)
- Re: Loading souce Elisp faster, Ivan Kanis, 2013/02/25
- Re: Loading souce Elisp faster, David Engster, 2013/02/25
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/26
- Re: Loading souce Elisp faster, David Engster, 2013/02/26
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/26
- Re: Loading souce Elisp faster, David Engster, 2013/02/26
- Re: Loading souce Elisp faster, Eli Zaretskii, 2013/02/26
- Re: Loading souce Elisp faster, David Engster, 2013/02/26
- Re: Loading souce Elisp faster,
David Engster <=
- RE: Loading souce Elisp faster, Drew Adams, 2013/02/26
- Re: Loading souce Elisp faster, Xue Fuqiao, 2013/02/26
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/26
- Re: Loading souce Elisp faster, Lennart Borgman, 2013/02/26
- Re: Loading souce Elisp faster, Richard Stallman, 2013/02/27
- Re: Loading souce Elisp faster, Stefan Monnier, 2013/02/27
- Re: Loading souce Elisp faster, Lennart Borgman, 2013/02/27
- Re: Loading souce Elisp faster, Achim Gratz, 2013/02/27
- Re: Loading souce Elisp faster, Lennart Borgman, 2013/02/27
- RE: Loading souce Elisp faster, Drew Adams, 2013/02/27