Closed wzslr321 closed 1 year ago
This library is a port of immutable.js
so I'm not sure what they're reasoning was for 32 specifically. IIRC the number needs to be a power of two so maybe it could be dropped down to 16 and that would make more sense.
It really only matters if you have a lot of small lists. In my experience, it's more common to see one or a few large immutable collections being shared rather than lots of small ones.
Thanks for the answer :)
List below contains 7 elements, but when I inspect it with debugger it resizes to length of 32, filling the rest with empty strings. I'm curious, what is the reason for that? I understand that resizing is expensive, but it seems like a little bit too much at first glance.