Skip to content

Add ZeroVec stack size tests #3427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2023
Merged

Add ZeroVec stack size tests #3427

merged 2 commits into from
May 12, 2023

Conversation

sffc
Copy link
Member

@sffc sffc commented May 12, 2023

Just a few more size tests in relation to #3413

ZeroVec is the same size as a Vec. I guess we can't easily make it any smaller.

VarZeroVec is 4 words. I think we lose a whole word because of the enum.

ZeroMap is the size of its two components.

ZeroMap2d is the size of three components plus the joiner array. This adds up very quickly!

FlexZeroVec is the same as ZeroVec.

Options of these types add a word for ZeroVec and FlexZeroVec but not for VarZeroVec, ZeroMap, or ZeroMap2d.

@sffc sffc requested a review from Manishearth as a code owner May 12, 2023 06:26
Manishearth
Manishearth previously approved these changes May 12, 2023
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may be able to condense VZV the same way we did ZV

@sffc
Copy link
Member Author

sffc commented May 12, 2023

I'd also like to consider making ZeroMaps be VarULE such that they can be the same size as a VarZeroVec. The easy way to do this is to just put the indices and values into the same buffer, one after the other; the offsets can be deterministically computed in a way that I expect to be negligible.

It would be nice to do this at the same time as the ZeroIndex work.

@Manishearth
Copy link
Member

Yes, I've wanted that for a while.

@sffc sffc requested a review from Manishearth May 12, 2023 19:25
@sffc sffc merged commit 90c8e14 into unicode-org:main May 12, 2023
@sffc sffc deleted the zv-size-tests branch May 12, 2023 22:51
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.

2 participants