emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unbearably slow editing in .h files


From: Alan Mackenzie
Subject: Re: Unbearably slow editing in .h files
Date: Sat, 23 Feb 2008 23:25:52 +0000
User-agent: Mutt/1.5.9i

'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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]