[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: slow output in *compilation* buffer
From: |
Stefan Monnier |
Subject: |
Re: slow output in *compilation* buffer |
Date: |
Tue, 25 Aug 2009 13:21:43 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>> - the re_* part of the profile is hard to improve with a quick fix,
>> I think: it just represents regexp-searching every one of the regexps
>> in compilation-error-regexp-alist in turn. Of course, there is a way
>> to do that (a lot) faster, by compiling all those regexps into a DFA.
> That sounds like a good idea, but it does not look like it will have a
> huge impact?
No, indeed, luckily.
>> - why does the gprof data only seem to account for a bit less than 10s
>> when you say it takes 25s to complete?
> Don't know. I double checked and it's consistent. Maybe oprofile can
> reveal more, I might try that too when I get a chance if nobody beats
> me to it.
Maybe it's just the user-time vs system-time.
>> - It seems that they the calls to the interval code come from
>> compilation-error-properties, but that function should only be called
>> for regexps that do match, which shouldn't be that many. Can you look
>> at the text to see if there really are that many matches? BTW, we
>> should probably be able to make compile.el a bit lazier (i.e. the
>> font-lock-phase part of the code should do a bit less work by moving
>> it to the next-error-phase code).
> The output is about 4500 lines, they all match.
Ah, I see. So yes, the likely solution is to make compile.el lazier:
use font-lock-syntactic-keywords and jit-lock (so the text past the end
of the window doesn't need to be scanned right away), and postpone more
of the work to next-error.
> BTW, doing the same search with M-x rgrep is MUCH MUCH slower.
That sucks. What does rgrep do so differently to make it even worse?
> They time spent there seems a bit excessive, so maybe something strange
> is going on...
That's also possible.
Stefan