Skip to content

Conversation

mcy
Copy link
Member

@mcy mcy commented Jan 9, 2025

Go's slices are quite large: 24 bytes on most platforms that will run Protocompile. We can use these bytes to store integer data inline, instead of having to make an allocation for each non-empty slice.

This PR adds slicesx.Inline, which is a slice of integers that stores very small arrays where the length/capacity would normally live. It also adds slicesx.Small, which is a slice without a capacity; this will be useful for the IR package, which will tend to have more immutable slices in it.

@mcy mcy requested a review from jhump January 9, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant