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

From: Gregory Heytings <[email-masked]>
Date: Tue, 16 Aug 2022 14:03:16 +0000

>> Without assuming that computers have infinitely fast CPUs, that is?
>
> If the font-lock rules to use in the buffer depend on whether the first 
> line of the buffer starts with #! or not, then your narrowing will break 
> them even tho they could work perfectly fine in a 1TB buffer without 
> requiring an infinitely fast CPU (since they don't need to scan the 
> whole buffer: just the region of interest plus the first 2 chars).
>

Why on earth should a font-lock rule check, inside each redisplay cycle, 
whether the first line of the buffer starts with #! or not?  Isn't that an 
information that can, and in fact should, be cached?