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
It would be nice, but I share your concern about a performance penalty - I'd rather waste memory than cycles, tbh. It might be a negligible hit, though - I'll try it and see.
In the standard library, the only collection that allocates when you call
new()
isVecDeque
, which will allocate space for 7 elements.By comparison, the collections in this library allocate a lot more. Using an element type of
u64
for testing:HashSet
(andHashMap
) will allocate a small amount for the hasher (which is typically a 0-size or Copy type) and 536 bytes of spaceOrdSet
allocates 1080 bytesVector
allocates 544 bytesI'm not sure if this is easily fixable without a performance penalty but it would be nice to not allocate at all.
The text was updated successfully, but these errors were encountered: