help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Fontifying grep results is slow


From: Andreas Politz
Subject: Re: Fontifying grep results is slow
Date: Wed, 08 Dec 2010 15:17:07 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Tim X <timx@nospam.dev.null> writes:

> Andreas Politz <politza@fh-trier.de> writes:
>
>> Hi,
>>
>> I don't understand, why the time needed for fontifying grep matches,
>> seems to be a function of the results buffer-length. Is this the result
>> of refontifying the whole buffer again and again after each insertion ?
>>
>> It's easily observable with a search generating tenth of thousands of
>> matches (at least on this machine), it gets slower, and slower ... and
>> slower. Until the insertion of new matches comes almost to a halt.
>>
>> Disable font-lock-mode and the results are almost immediately available.
>> Reenabling it in buffer with many matches takes forever.
>>
>> Is this maybe a matter of to general, to much regexpes ?
>>
>
> I'm assuming your talking about M-x grep rather than running grep in a
> shell buffer etc. 

Yes.

>
> There are quite a few variables involved and it could be any one of
> them. Possibilities include -
>
> 1. Additional font-locking packages, such as devlock and its settings
> 2. The font-lock-support-mode being used - check it is jit-lock
> 3. Check setting of font-lock-maximum-decoration
> 4. Other modes, like longlinges-mode or other line wrapping settings may
> have an impact here, not sure. May depend on how long your lines are.. 

emacs -Q here.

I guess the main point, I would like to understand is, if (at all) and
why the time spend fontifying a new line of grep result seems to be a
function on the size of the result buffer.

Anyway I guess I should try to reduce the complexity of the font-lock
regexps. 
>
> You can also try tweaking things to see if that improves matters. i.e.
> changing value for font-lock-maximum-size and
> font-lock-maximum-decoration, turning off devlock if installed, changing
> the faces used by grep etc. 
>
> I don't notice any significant slowdown, but I have a fairly fast
> machine with lots of memory and tend to rarely do grep's that will
> return large data sets. 

That's good for you, because it's not usable anyway  (At least with
font-lock enabled.).
>
> Tim

-ap


reply via email to

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