nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] RFC: should color precalculation stay abortable?


From: Benno Schulenberg
Subject: [Nano-devel] RFC: should color precalculation stay abortable?
Date: Mon, 11 Jul 2016 17:24:49 +0200

Hi,

Currently, when nano has loaded a file and syntax highlighting is
being used, the first thing it does, before displaying the file,
is to precalculate the data for the multiline highlighting rules
(the ones with start="" end="").  In a really huge file and with
several multiline rules, this might take a short while, so, to humor
the impatient user, together with the precalculation, a mechanism
was added to abort this calculation [1] and just fall back to
calculating the data on the fly.  The thing is: the calculation
on the fly is *way* slower than the precalculation, and thus,
when the target line is deep into the file, startup will actually
take *much* longer when the user is impatient and starts typing
right after hitting Enter on the command line.

To test: cp ChangeLog cl.py, then run: src/nano +4000 cl.py.
See how loading and showing the file takes less than a second.
Exit from nano, and run the same again: src/nano +4000 cl.py,
but now very quickly after hitting Enter type some other key,
say D.  See how it takes some *ten* seconds before the file
is finally shown.

So I suggest to remove the abortion mechanism, as it only slows
things down (when not starting near the head of the file).

Opinions?

Benno


[1]  git log -p -1 364763f

See also https://savannah.gnu.org/bugs/?48389.

-- 
http://www.fastmail.com - A fast, anti-spam email service.




reply via email to

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