Skip to content
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

Investigate the possibility of u16 lengths in VarZeroVec #1261

Closed
Tracked by #1082
Manishearth opened this issue Nov 4, 2021 · 2 comments
Closed
Tracked by #1082

Investigate the possibility of u16 lengths in VarZeroVec #1261

Manishearth opened this issue Nov 4, 2021 · 2 comments
Labels
A-performance Area: Performance (CPU, Memory) C-data-infra Component: provider, datagen, fallback, adapters

Comments

@Manishearth
Copy link
Member

Currently VarZeroVec assumes that individual entries may have lengths that fit up to u32 in size. This is quite reasonable, however this is using 4 bytes per element. It may be more efficient to use a u16 here. rkyv uses u16s but is parametrizable.

It's worth discussing whether VarZeroVec<T> will ever contain Ts that are large enough to need more than a u16s worth of space (64 KB) to store their byte length. Note that VarZeroVecs can be nested.

Independently of this, it's also worth considering if VarZeroVec<T> can be made VarZeroVec<T, N = 2> so we can allow for arbitrary length sizes.

@Manishearth Manishearth added A-performance Area: Performance (CPU, Memory) C-data-infra Component: provider, datagen, fallback, adapters discuss Discuss at a future ICU4X-SC meeting labels Nov 4, 2021
@Manishearth
Copy link
Member Author

Closing in favor of #1410

@sffc sffc removed the discuss Discuss at a future ICU4X-SC meeting label Mar 4, 2022
@sffc
Copy link
Member

sffc commented Mar 4, 2022

Subsumed by #1443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-performance Area: Performance (CPU, Memory) C-data-infra Component: provider, datagen, fallback, adapters
Projects
None yet
Development

No branches or pull requests

2 participants