[Top][All Lists]

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

Re: How to add pseudo vector types

From: Óscar Fuentes
Subject: Re: How to add pseudo vector types
Date: Sat, 24 Jul 2021 05:39:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> 39 milliseconds for re-indent is just slow enough to be noticeable; I still
> have algorithms to convert to be as incremental as possible.


> In a very small file:
> initial   0.000632 seconds
> re-indent 0.000942 seconds
> Easily fast enough to keep up with the user.

Doing work every time the user changes the file is not always a good
thing. Nowadays the user doesn't just expect automatic indentation, he
wants code formatting too, which means splitting, fusing and inserting
lines, plus moving chunks of code left and right. Doing that every time
a character is added or deleted can be visually confusing due to chunks
of text changing positions as you type, so the systems I know are
triggered by certain events (like the insertion of characters that mark
the end of statements). Then they analyze the code and, if it is well
formed, apply the reformatting. Something similar could be said about
fontification and other tasks.

In my experience, delays of 0.1 seconds are perfectly acceptable with
this method.

So I'll insist on not obsessing too much about performance. Implement
something simple, see if it is usable. If not, invest effort on
optimizations until it is good enough.

reply via email to

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