Subject: Re: bug#56682: Fix the long lines font locking related slowdowns

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 Jul 2022 13:59:32 +0300

> Date: Sat, 30 Jul 2022 10:52:48 +0000
> From: Gregory Heytings <[email-masked]>
> cc: Stefan Monnier <[email-masked]>, [email-masked]
> 
> >> I'd suggest to keep things mostly as they are but move the decision to 
> >> ELisp: i.e. pass the beg..end limits to jit-lock and let jit-lock do 
> >> the narrowing.  This way it's easy to later refine the mechanism.
> >
> > That's already happening: code called via fontification-functions can 
> > access the restriction via point-min and point-max.  If you or someone 
> > else can come up with efficient methods of using that information so as 
> > not to go too far forward and back, we could consider removing the lock 
> > from the narrowing.  But we'd need to see the code first and assess the 
> > resulting performance with long lines.
> >
> 
> IIUC, what Stefan suggests is the following, which seems (almost) fine to 
> me.

I fail to see the difference, sorry.  Instead of doing the narrowing
from C we leave it to jit-lock, but tell it the limits to narrow to?
Or am I missing something?