bugGNU nano - Bugs: bug #56522, [Task] change the flags to use an...

 
 

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

bug #56522: [Task] change the flags to use an array of bytes or shorts instead of bits

Submitter:  Benno Schulenberg <bens>
Submitted:  Wed 19 Jun 2019 07:01:14 AM UTC
   
 
Severity:  1 - Wish Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed

Sun 01 Dec 2019 04:13:51 PM UTC, comment #1: 

Not worth it.  The recent optimizations of advance_over() and collect_char() have probably brought more than changing all the flags to bools would ever bring.  So let it be.

(Although, just for SOFTWRAP, it might be worth it to introduce a global bool that shadows its setting...)

Benno Schulenberg <bens>
Group administrator
Wed 19 Jun 2019 07:01:14 AM UTC, original submission:  

Since the beginning, the flags in nano (SMART_HOME, HISTORYLOG, QUICK_BLANK, and so on) have been an array of bits, implemented within an array of four integers.  This means that each SET() and UNSET() requires a read-mask-write cycle instead of each being just a single write.  This is not so bad, because setting and unsetting happen infrequently.  But also the checking of the flag with ISSET() involves a read plus a mask operation, instead of being a single read.

Is saving two nanoseconds per flag check worth it?  For most flags probably not, but...  SOFTWRAP gets checked so often (in the paths that are called often) that it would be nice if this check were quicker.

Benno Schulenberg <bens>
Group administrator

 

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

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)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-01 bens StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code