From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Ponce Newsgroups: gmane.emacs.devel Subject: Re: byte-compiler very slow Date: Tue, 23 Jul 2002 14:06:50 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <3D3D46DA.9040700@dponce.com> References: <3D39C79B.6020605@dponce.com> <200207212015.g6LKFgA00958@aztec.santafe.edu> <1027284727.5453.5.camel@space-ghost> <200207221519.g6MFJnK02311@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1027425925 31226 127.0.0.1 (23 Jul 2002 12:05:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Jul 2002 12:05:25 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17WyPs-00087X-00 for ; Tue, 23 Jul 2002 14:05:24 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17WyeB-0002gV-00 for ; Tue, 23 Jul 2002 14:20:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17WyPt-0003T0-00; Tue, 23 Jul 2002 08:05:25 -0400 Original-Received: from smtp-out-3.wanadoo.fr ([193.252.19.233] helo=mel-rto3.wanadoo.fr) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17WyOa-0003QF-00; Tue, 23 Jul 2002 08:04:04 -0400 Original-Received: from mel-rta10.wanadoo.fr (193.252.19.193) by mel-rto3.wanadoo.fr (6.5.007) id 3D1848E600EDF3C6; Tue, 23 Jul 2002 14:04:03 +0200 Original-Received: from dponce.com (193.248.132.200) by mel-rta10.wanadoo.fr (6.5.007) id 3D2A7916006FC7D0; Tue, 23 Jul 2002 14:04:03 +0200 User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1b) Gecko/20020720 X-Accept-Language: fr, en-us, en Original-To: rms@gnu.org Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5988 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5988 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