emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs rendering comparisson between emacs23 and emacs26.3


From: Stefan Monnier
Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Tue, 07 Apr 2020 23:48:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I found the open-paren-in-column-0 heuristic satisfactory because in
> practice I saw that open-parens did not drift into column zero.

Yes, it was a good heuristic when we needed one and when a heuristic was
good enough.  Nowadays it's not good enough any more.  Users who
experience a misbehavior because some "stray" open-paren in column-0
don't think "oh silly me, I shouldn't do that".  Instead they think
"Duh!  Emacs is stupid!".

> It presumes that the developers adopt the practice of indenting the
> text of block comments, or can be persuaded to do so.

What about those who can't or don't want to?

Should Emacs provide poor behavior when open parens in column 0 occur
for non-defuns?  Should Emacs provide poor performance when the buffer
doesn't have any open-parens in column 0 (as is the common case in many
languages)?

For these reasons, we came up with a different approach, not based on
a heuristic.  To make it work sufficiently efficiently it relies
on caching.  It's not always as efficient as the old heuristic, but on
the average it is more efficient, in the worst case it's a bit less
efficient, and in the best case it's a lot more efficient.

OK, I've wasted enough time in this thread, so I'll stop here.

I just recommend anyone who wants to hack on this problem to first do
some careful profiling (both at the Elisp level and the C level).
Then see if maybe the performance improvement that they're aiming for
can't be obtained simply by optimizing syntax-ppss (e.g. it's a pretty
simple code so it would not be hard to move it to C, if needed).

Finally, I'd urge anyone who's not willing to spend this effort to stop
arguing here about what they think should be done, because the likelihood
that the profiler would prove them wrong is just much too high.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]