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

VarZeroVec refactoring and cleanup #2047

Merged
merged 17 commits into from
Jul 11, 2022
Merged

VarZeroVec refactoring and cleanup #2047

merged 17 commits into from
Jul 11, 2022

Conversation

sffc
Copy link
Member

@sffc sffc commented Jun 11, 2022

This PR does not to my knowledge affect the performance of VarZeroVec; it cleans things up in preparation for a generalization of the indices array to other storage mechanisms.

Part of #1410

@sffc sffc marked this pull request as ready for review June 25, 2022 05:19
@sffc sffc requested review from Manishearth and a team as code owners June 25, 2022 05:19
@sffc
Copy link
Member Author

sffc commented Jun 27, 2022

iai across this change:

varzeroslice_parse_get
  Instructions:                 413 (+6.994819%)
  L1 Accesses:                  509 (+5.383023%)
  L2 Accesses:                    3 (+50.00000%)
  RAM Accesses:                  16 (+14.28571%)
  Estimated Cycles:            1084 (+10.27467%)

varzeroslice_get
  Instructions:                  28 (No change)
  L1 Accesses:                   35 (No change)
  L2 Accesses:                    2 (No change)
  RAM Accesses:                   4 (No change)
  Estimated Cycles:             185 (No change)

varzeroslice_get_unchecked
  Instructions:                  29 (No change)
  L1 Accesses:                   36 (No change)
  L2 Accesses:                    2 (No change)
  RAM Accesses:                   4 (No change)
  Estimated Cycles:             186 (No change)

To reproduce, run: cargo test --release --all-features --all-targets

Manishearth
Manishearth previously approved these changes Jun 27, 2022
@@ -31,7 +31,7 @@ fn usizeify(x: RawBytesULE<INDEX_WIDTH>) -> usize {
pub struct VarZeroVecComponents<'a, T: ?Sized> {
len: u32,
/// The list of indices into the `things` slice
indices: &'a [RawBytesULE<INDEX_WIDTH>],
indices: &'a [u8],
Copy link
Member

Choose a reason for hiding this comment

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

thought: hmm, the point of VZVComponents was to have this be precalcualted, but I assume it doesn't actually have a perf impact here since it's not a real calculation

utils/zerovec/src/varzerovec/owned.rs Outdated Show resolved Hide resolved
@sffc sffc merged commit 138e2ae into unicode-org:main Jul 11, 2022
@sffc sffc deleted the vzv-clean branch July 11, 2022 21:12
samchen61661 pushed a commit to samchen61661/icu4x that referenced this pull request Jul 12, 2022
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