emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Re: jit lock sit-for provokes redisplay provokes ime


From: martin rudalics
Subject: Re: address@hidden: Re: jit lock sit-for provokes redisplay provokes imenu]
Date: Thu, 31 Aug 2006 08:11:12 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> martin rudalics <address@hidden> writes:
>
>
>>>Stefan wrote:
>>>
>>>    This only eliminates one particular source of unwanted updates.  I don't
>>>    think this code is worth the trouble.
>>>
>>>That cause of unwanted updates is the only one we know of.  Nothing
>>>else is likely to change the buffer in the background.
>>
>>`jit-lock-fontify-now' during scrolling, searching, window resizing.
>>Not mentioning the plethora of "hidden buffer changes" in c-mode.
>
>
> AFAIU, those are much less problematic than the changes during stealth
> fontification.  That's because stealth fontification takes place in a
> timer, while Emacs is idle, and makes a change every 0.5 seconds (by
> default).

Not since we changed `jit-lock-stealth-fontify'.  Remember: The old call
chain was `jit-lock-stealth-fontify' -> `sit-for' -> `sit_for' ->
`redisplay_preserve_echo_area' -> `redisplay_internal' ->
`prepare_menu_bars' -> `update_menu_bar' with the notorious
`windows_or_buffers_changed' check and the subsequent run of
`Qmenu_bar_update_hook' which contains `imenu-update-menubar'.

But we _removed_ `sit-for' from `jit-lock-stealth-fontify' and hence
stealth fontification doesn't redisplay anymore.  That's been my entire
motivation for patching this.  I think, most people complaining about
stealth fontification overhead in fact complained about those senseless
_redisplays_ stealth fontification's `sit-for' incurred every 0.5 secs.
(Compare the current "silent PC vs. emacs" thread on emacs-pretest-bug.)

Hence the only overhead incurred by stealth fontification nowadays
should be due to the fact that it "modified" the buffer, the user (or
process output) interrupted stealth fontifcation, and as a consequence
`imenu-update-menubar' is run.  We can ignore that.

The buffer changes during scrolling and window resizing, however, are
considerably more serious since they affect responsiveness of Emacs.  My
Emacs considerably lags behind other applications during scrolling and
flickers noticeably whenever I drag a modeline.  Now consider that for
every _single_ line dragged or scrolled I call `imenu-update-menubar'.
The only buffer "change" here is the fontification of one single line.
That doesn't make any sense.  And it makes the speed of scrolling depend
(1) on the size of the buffer and (2) the quality of a thing like
`imenu-create-index-function'.  Wouldn't it make more sense to spend
that time to filter out, for example, all those definitions Imenu finds
in C comments or strings?





reply via email to

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