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

Submitted by:  Benno Schulenberg <bens>
Submitted on:  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>
Project 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>
Project Administrator


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 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.5