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

[DO NOT MERGE] bench: block v2 iterator bench #1138

Closed
wants to merge 5 commits into from
Closed

Conversation

MrCroxx
Copy link
Contributor

@MrCroxx MrCroxx commented Mar 22, 2022

Key format: | 't' | tid (u32) | pk (u64) |
Value format: v (u64)
Each block contains 10 tid, each tid contains 100 entries (in order).
BlockV2 restart point interval: 16

Under the circumstances:

  • BlockV2 encoding needs only half of the space of Block.
  • But the performance of iterators regressed. But the performance of prev regressed.
  • The regression of next may because copies of my implementation.
  • The regression of prev, in theory, is next * (restart point interval / 2)

image

UPDATES: After optimization, BlockIteratorV2::next() is better than the origin one.

@MrCroxx MrCroxx self-assigned this Mar 22, 2022
@MrCroxx MrCroxx marked this pull request as draft March 22, 2022 04:07
@MrCroxx
Copy link
Contributor Author

MrCroxx commented Mar 22, 2022

image

@MrCroxx
Copy link
Contributor Author

MrCroxx commented Mar 22, 2022

Seems the regression comes from Bytes::slice(), after removing unnecessary Bytes::slice(), BlockIteratorV2::next() shows better performance than BlockIterator::next().

image

image

commits:

You can download the svg and view them interactively.

b5964a8 (after optimization)

flamegraph b5964a8

a32751f (before optimization, next only)

flamegraph a32751f

@MrCroxx
Copy link
Contributor Author

MrCroxx commented Mar 22, 2022

Enough for now. Reopen anytime if needed.

@MrCroxx MrCroxx closed this Mar 22, 2022
@MrCroxx MrCroxx reopened this Mar 22, 2022
@MrCroxx
Copy link
Contributor Author

MrCroxx commented Mar 24, 2022

Close.

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.

None yet

1 participant