>>>> "nix" == nix
<nix(a)esperi.demon.co.uk> writes:
nix> On 08 Feb 2002, Stephen J. Turnbull spake:
> Remember all we're doing here is to _indent one line_.
nix> Um, since C is a (somewhat) context-sensitive language, and
I doubt the minimal degree of context sensitivity in C/C++/Java is
what's relevant here. I'm sure it's dominated by the fact that the
indentation itself is context-sensitive. But I thought context was
relative, that is invariably local to the current list and its prefix
(eg, there are all kinds of switch () {} conventions, and they
generally are quite different from things like function definitions
that look sort of like that).
I gather you're trying to tell me that's false?
nix> In some (admittedly pathological) cases involving K&R
nix> declarations and/or hanging-brace K&R brace style, it may
nix> have to chase all the way up to the top of the buffer and
nix> back down to work out what your indentation level is.
Yeah, but it doesn't seem to be an issue of pathology. It simply
seems to be a matter of buffer size. It seems that something is
_always_ chasing indentation or syntax over the whole buffer.
Did you look at the profile? One indentation causes 998 scan-lists in
a 7000 line file! What with comment lines and the like, it sounds to
me like it's doing a scan-list for a very large proportion of the
lists in the file. This could very easily mean that get-text-property
happens on the order of N^2 due to nesting of lists. Even
microseconds add up quickly in units of 100^2.
nix> I don't think this will be fixable without truly massive
nix> changes to cc-mode (which would probably cripple its
nix> indentation engine again).
That would be a bummer. But it would also be a bummer to find
ourselves forced to give up local syntax tables just because one
important application is wedded to an N^2 algorithm or something like
that.
--
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.