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

perf: rewrite skip function #185

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

bobozhengsir
Copy link
Contributor

Rewrite skip function using loops and fast skipping for fixed-length types

Motivation

Improving the performance of the skip function.

Solution

Using loops and fast skipping for fixed-length types.

cargo bench result(the old version is baseline):

 Thrift Binary Skip Bench/binary_unsafe skip list<i32>
                        time:   [32.492 ns 32.665 ns 32.859 ns]
                        change: [-93.907% -93.787% -93.682%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe

Thrift Binary Skip Bench/binary_unsafe skip struct
                        time:   [342.44 ns 346.33 ns 350.27 ns]
                        change: [-6.1207% -4.4530% -2.6464%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

@bobozhengsir bobozhengsir requested review from a team as code owners August 3, 2023 06:09
@CLAassistant
Copy link

CLAassistant commented Aug 3, 2023

CLA assistant check
All committers have signed the CLA.

Millione
Millione previously approved these changes Aug 3, 2023
@bobozhengsir bobozhengsir merged commit 03350fd into cloudwego:main Aug 3, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants