You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any reason why bitfields are not used more in NodeJS?
e.g. the readable and writable state footprint can easily be reduced by more than 50% by switching all of those different boolean flags into a single 16/32 bit bitfield. Reducing memory usage and improving CPU cache access.
@addaleax: So from my research it seems the performance improvements are small (0-10%) and some cognitive overhead is involved. The only reason this might be worth looking into is to reduce memory usage (which can be relevant for e.g. http).
Activity
ronag commentedon Aug 14, 2019
e.g. readable state
from 23 (184 bytes?):
to 9 (72 byttes? almost fits in cacheline):
addaleax commentedon Aug 14, 2019
Yes. Would you be interested in opening a PR and seeing how the benchmarks go?
ronag commentedon Aug 17, 2019
@addaleax: So from my research it seems the performance improvements are small (0-10%) and some cognitive overhead is involved. The only reason this might be worth looking into is to reduce memory usage (which can be relevant for e.g. http).
Should we close this?