bugGNU nano - Bugs: bug #50399, constant position display...

 
 

bug #50399: constant position display (--constantshow) is very slow

Submitted by:  Sworddragon <sworddragon>
Submitted on:  Sat 25 Feb 2017 02:02:43 PM UTC  
 
Severity: 3 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 26 Feb 2017 12:35:57 PM UTC, comment #1:

(The issue with reading in a large file has been rereported as bug #50406. The current bug will be only about --constantshow.)

To reproduce, run 'for x in $(seq 45); do cat src/.c >>million; done'. Open the file: 'nano --ignore --constant million'. Type <Down> a few times. Nano responds virtually instantly. Now type M-/. It takes eight* seconds before nano finally shows the bottom of the file. This is unusable. Now type <Up> a few times quickly in a row. It takes nano again eight seconds to show the result of the first <Up>, and another eight seconds to show the result of the rest of the keystrokes. Useless.

With constant position display, nano recomputes the number of characters up to the position of the cursor /every/ time the cursor is moved. This is an enormous waste of time.

If you open the same file with Pico, the result of typing ^C is nearly instantaneous, wherever the cursor is in the file. I am guessing that Pico stores the number of characters that each line contains, and when ^C is pressed, it quickly adds up all these numbers of the lines before the cursor, plus the number of characters on the current line before the cursor. Nano should do something similar, because recounting all the characters up to the cursor for every keystroke is utterly wasteful.

This is not so easy, though: when cutting or pasting text, things can be cut or inserted midline, so it will take a lot of extra hassle to get the character counts for each affected line right.

Benno Schulenberg <bens>
Project Administrator
Sat 25 Feb 2017 02:02:43 PM UTC, original submission:

I'm using nano 2.7.4 and I'm noticing that the performance is not that good in some cases:

- Opening a log file that has a size of 235 MiB needs a bit over 10 seconds to open. This is not very bad but maybe this can be enhanced a bit.

- But the main issue is that using "set const" does decrease the performance very fast if a few tenthousand lines are reached. This seems to get even worse if going down is continued.

Sworddragon <sworddragon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by sworddragon (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 26 Feb 2017 12:35:57 PM UTCbensSummaryPerformance is not optimal=>constant position display (--constantshow) is very slow

    Back to the top


    Powered by Savane 3.1-cleanup1