[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nano-devel
Subject:    [Nano-devel] RFC: should color precalculation stay abortable?
From:       Benno Schulenberg <bensberg () justemail ! net>
Date:       2016-07-11 15:24:49
Message-ID: 1468250689.2557205.662903457.308631A9 () webmail ! messagingengine ! com
[Download RAW message or body]


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.


_______________________________________________
Nano-devel mailing list
Nano-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/nano-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic