Subject: Re: bug#16526: 24.3.50; scroll-conservatively & c-mode regression

From: Alan Mackenzie <[email-masked]>
Date: Sat, 5 Jul 2014 20:25:34 +0000

Hi, Stefan.

On Fri, Jul 04, 2014 at 03:43:02PM -0400, Stefan Monnier wrote:
> > I'm not sure what I'm meant to see, but it has made no perceptible
> > difference to the "slow" invocation of scan-lists.  In particular, that
> > invocation took 0.7196781635284424 seconds with the patch, which is
> > "exactly" (near enough) what it took before.

> OK, the initialization needs to be after the "lossage:" label,
> of course.  Try the patch below instead,

This works considerably better.  :-)  The critical scan-lists took
0.12084102630615234 seconds, a speedup of a factor of ~7.  It may be even
larger than that because of the instrumentation in the patch.

CC Mode has a problem in that it does too many backward scan-lists.
There is no documentation anywhere of what open-paren-in-column-0-etc
does; its sole effect is in backwards scan-lists which encounter
"syntactically unbalanced" comments, this causing a scan of the buffer
from point-min.  When I optimised c-parse-state a few years back, I was
under the impression that a backwards scan-lists wasn't much more
expensive than a forwards one.  Often, this is not true.  I should think
about adjusting c-parse-state again.  It surely wouldn't hurt for the
documentation of open-paren-etc and scan-lists to be a bit more
forthcoming about backwards scan-listses and what the variable _really_
does.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).