patchGNU nano - Patches: patch #9270, fix another inefficiency in...

 
 

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

patch #9270: fix another inefficiency in display_string(), with very long lines

Submitter:  David Lawrence Ramsey <dolorous>
Submitted:  Fri 24 Feb 2017 09:04:17 PM UTC
   
 
Priority:  3 - Low Status:  Done
Privacy:  Public Assigned to:  dolorous
Open/Closed:  Closed Release:  None

Tue 28 Feb 2017 04:21:53 PM UTC, comment #3: 

Applied to git, 0404474e, with a rename plus a significant modification: the column beyond the last one is computed from the original start_col, not from the possibly increased start_col due to double-width characters straddling the screen's edge.

Thanks.

Benno Schulenberg <bens>
Group administrator
Sat 25 Feb 2017 04:25:46 PM UTC, comment #2: 

Oops.  Attached a second version fixing this.

(file #39830)

David Lawrence Ramsey <dolorous>
Group Member
Sat 25 Feb 2017 10:11:14 AM UTC, comment #1: 

Ehm...  The idea sounds good, but the implementation...

  start_col <= start_col + span

This will always be true, meaning that it has zero effect.

Benno Schulenberg <bens>
Group administrator
Fri 24 Feb 2017 09:04:17 PM UTC, original submission:  

In current git, display_string() starts scanning text at column start_col/index start_index, and uses start_col to count the number of columns' worth of characters it gets.  However, it goes all the way to the end of the text when doing so, and then uses null_at() to cut the text off after span columns.  Going through all of the text is unnecessary, and eats up a lot of extra processing time if the line is far longer than that.

The attached patch makes display_string() stop going through the text as soon as we get more than span columns' worth of it.

David Lawrence Ramsey <dolorous>
Group Member

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-02 bens Open/ClosedOpen Closed
    2017-02-28 bens Priority5 - Normal 3 - Low
        StatusNone Done
        Assigned toNone dolorous
    2017-02-25 dolorous Attached File- Added 0001-tweaks-stop-processing-text-once-we-overshoot-span-c.patch, #39830
    2017-02-24 dolorous Attached File- Added 0001-tweaks-stop-processing-text-once-we-overshoot-span-c.patch, #39824

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code