Incidentally, I have seen *extreme* slowness with a font-locked .newsrc.eld
file. This has few lines but the lines are all thousands of characters
long. Motion and isearch in such a buffer takes for ever.
andy
At 03:54 PM 3/12/02 +0900, Stephen J. Turnbull wrote:
>>>>> "Jan" == Jan Vroonhof
<jan(a)xemacs.org> writes:
Jan> update_syntax_cache basically
Jan> - Computes the Qsyntax_table property using Fget_char_property
Jan> - Estimates the boundaries of the region where this table
Jan> is valid using Fprevious_extent_change and
Jan> Fnext_extent_change (note that this is a vast underestimate,
Jan> most of the time this will be (point-min) and (point-max)).
In fact, most of the time in everything except cperl mode
Qsyntax_table should be nil (or maybe the default). So one dirty
trick is to simply arrange to dirty a flag in any buffer where the
syntax-table property is ever set. That would be a lot faster than
using Fget_char_property.
Jan> 3. IIRC correctly syntax property extents cannot overlap,
Jan> therefore the boundaries of the extent where we found the
Jan> current property value are good values for the cache
Jan> boundaries and much more likely to be bigger (possibly even
Jan> the whole buffer).
This is probably true. However, even if not there's a way to just
walk the extents that overlap this one. Note that if this one is big,
then we do a big computation once, and avoid further computation for a
long time. When the profit is small, the computation is also small.
Also, you may want the dirty flag anyway (to invalidate these cache
boundaries).
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Don't ask how you can "do" free software business;
ask what your business can "do for" free software.