bugGNU nano - Bugs: bug #60429, toggling line numbers can be slow...


You are not allowed to post comments on this tracker with your current authentication level.

bug #60429: toggling line numbers can be slow when using --softwrap

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Wed 21 Apr 2021 09:50:33 AM UTC  
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

Wed 21 Apr 2021 03:10:10 PM UTC, comment #1: 

Fixed in git, commit 49d8b99e, by removing all the costly recomputations of 'extrarows'.

The resulting incorrect large size of the indicator when there are several softwrapped chunks on the screen will be addressed later.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 21 Apr 2021 09:50:33 AM UTC, original submission:  

To reproduce, download http://unicode.org/Public/UCD/latest/ucdxml/ucd.all.grouped.zip, unzip, and then run:

src/nano --ignore --softwrap ucd.all.grouped.xml

Reading the file seems to take about two seconds.  But it's not the actual reading that takes so much time.  Because: now switch line numbers on with M-N.  It takes about a second before the line numbers appear.  Now switch the line numbers bakc off: M-N.  It takes about a second before the line numbers disappear.  This is unacceptable.  Toggling the line numbers should be instantaneous.

The problem is that 'extrarows' needs to be recomputed (for ALL lines in the buffer) whenever the width of the edit window changes.  But this 'extrarows' is really only used (needed) when the indicator is present.  But most people will not be using the indicator, and there seem to be quite a few people who use softwrap.  So for many people these computations of 'extrarows' is a pure waste of CPU cycles.

When 'extrarows' was first introduced, I thought it could maybe be used to speed up the rendering when softwrap is on.  But it hasn't happened until now, and I have too little interest in softwrap to look into this.  So... a quick mitigation would be to only compute 'extraows' when the indicator is on.  And after that... maybe delete 'extrarows' entirely and let the indicator always follow real lines instead of visual lines?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-30 bens Open/ClosedOpen => Closed
    2021-04-21 bens Severity3 - Normal => 2 - Minor
        StatusNone => Fixed

    Back to the top

    Powered by Savane 3.7