From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Unbearably slow editing in .h files Date: Sat, 23 Feb 2008 23:25:52 +0000 Message-ID: <20080223232552.GC3476@muc.de> References: <8763xl492o.fsf@jurta.org> <200801230225.m0N2Ptmx012952@sallyv1.ics.uci.edu> <200801271954.m0RJsmBm003714@sallyv1.ics.uci.edu> <479DAC55.8070302@gmx.at> <200801300258.m0U2w9rr005169@sallyv1.ics.uci.edu> <47B9E0B1.1090908@gmx.at> <20080223224901.GB3476@muc.de> <47C0A376.8080105@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203808397 795 80.91.229.12 (23 Feb 2008 23:13:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Feb 2008 23:13:17 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 24 00:13:42 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JT3Yq-0000BZ-65 for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 00:13:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT3YK-0005uC-GR for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2008 18:13:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT3YG-0005rK-4a for emacs-devel@gnu.org; Sat, 23 Feb 2008 18:13:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT3YE-0005ph-VO for emacs-devel@gnu.org; Sat, 23 Feb 2008 18:13:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT3YE-0005pd-Qf for emacs-devel@gnu.org; Sat, 23 Feb 2008 18:13:02 -0500 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JT3YE-0001h1-CU for emacs-devel@gnu.org; Sat, 23 Feb 2008 18:13:02 -0500 Original-Received: (qmail 92314 invoked by uid 3782); 23 Feb 2008 23:13:00 -0000 Original-Received: from acm.muc.de (p57AF623D.dip.t-dialin.net [87.175.98.61]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 24 Feb 2008 00:12:58 +0100 Original-Received: (qmail 7270 invoked by uid 1000); 23 Feb 2008 23:25:52 -0000 Content-Disposition: inline In-Reply-To: <47C0A376.8080105@gmx.at> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90179 Archived-At: 'n Abend, Martin! On Sat, Feb 23, 2008 at 11:51:34PM +0100, martin rudalics wrote: > Evening Alan, > > What is add-log-current-defun using c-beginning-of-defun for? > Visit lisp.h, go to the end of the buffer, and do > M-x RET c-beginning-of-defun RET > Convincing? Yes, very. Sadly. It takes about 18 seconds for me (1.2 GHz Athlon). However, it is having to analyze over 54kBytes of C source between EOB and EO-last-defun. This time is taken up almost fully by the call to c-where-wrt-to-brace-construct. Maybe this could be optimised. Maybe, on the other hand, it's not reasonable to expect anything faster in this pathological case. By comparison, if you do the same in lread.c, it takes much less than a second. It may be that the plethora of macros in lisp.h is causing the delay. However, there are two problems conflated in this thread. There's the slowness in certain C files, and there's the way C-x 4 a calls c-\(beginning\|end\)-of-defun five times. Lets separate them! 5 x 18s = 1.5 minutes. This is the other thing that is slugging C-x 4 a. add-log-current-defun is _emulating_ c-where-wrt-to-brace-construct, and emulations tend to be slow. ;-) -- Alan.