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
Optimizing the internal representation of gno slices
A custom data structure where it either holds an array of const N or the current slice implementation.
The empty slots in the array are filled with nil.
When push number N + 1 happens, the elements are moved from the array to the slice.
Statistically, most slices/vectors are of small size. So a reasonable N can be anything up to 10.
This could potentially have several benefits.
Appending up to N does not cause reallocation
Removed 1 layer of heap indirection
Compiler optimizations
The text was updated successfully, but these errors were encountered:
Optimizing the internal representation of gno slices
A custom data structure where it either holds an array of const N or the current slice implementation.
The empty slots in the array are filled with nil.
When push number N + 1 happens, the elements are moved from the array to the slice.
Statistically, most slices/vectors are of small size. So a reasonable N can be anything up to 10.
This could potentially have several benefits.
The text was updated successfully, but these errors were encountered: