[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: byte-compiler very slow
From: |
David Ponce |
Subject: |
Re: byte-compiler very slow |
Date: |
Tue, 23 Jul 2002 14:06:50 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1b) Gecko/20020720 |
Hi All,
I think I found the cause of the byte-compiler slow down. I profiled
the byte-compiler and finally found that most of the byte-compilation
time was spent in the function `symbol-file' called from
`byte-compile-cl-warn'. In fact I found that the time spent in
`symbol-file' is proportional to the size of `load-history'.
Here is a summary profiling result I got when byte-compiling edebug.el
in my normal working environment where `load-history' is quite big:
Function Name Call Count Elapsed Time Average Time
======================= ========== ============ ============
emacs-lisp-byte-compile 1 12.077 12.077
symbol-file 3590 9.0729999999 0.0025272980
That clearly shows that 75% of compilation time is spent in
`symbol-file'!
Here is the result I got just after `emacs -q --no-site-file' when
`load-history' should be at minimal size:
Function Name Call Count Elapsed Time Average Time
======================= ========== ============ ============
emacs-lisp-byte-compile 1 3.235 3.235
symbol-file 3589 0.9410000000 0.0002621900
In that case only 29% of time is spent in `symbol-file'!
To confirm these results I hacked a version of bytecomp.el where I
replaced `byte-compile-cl-warn' with the following:
(defsubst byte-compile-cl-warn (form)
"Warn if FORM is a call of a function from the CL package."
form)
And magically, the byte-compiler recovered its speed :-)
Hope this will help.
Sincerely,
David