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

opt: remove bound and loop unrolling in quote (begin to use clang13) #237

Merged
merged 9 commits into from Jun 8, 2022

Conversation

liuq19
Copy link
Collaborator

@liuq19 liuq19 commented May 27, 2022

Through calculating the max size of the quoted buffer, remove lots of branch and use loop unrolling.

performance

name                          old time/op    new time/op    delta
Encoder_Generic_Sonic_Std       49.2µs ± 2%    46.8µs ± 1%   -4.95%  (p=0.000 n=9+9)
Encoder_Generic_Sonic_StdNot    32.8µs ± 2%    28.8µs ± 3%  -12.13%  (p=0.000 n=10+8)
Encoder_Escaped_Sonic_StdNot    83.9µs ± 3%    71.4µs ± 7%  -14.86%  (p=0.000 n=10+10)
Encoder_Binding_Sonic_Std       8.31µs ± 3%    6.87µs ± 3%  -17.32%  (p=0.000 n=10+10)
Encoder_Binding_Sonic_StdNot    7.56µs ± 5%    5.82µs ± 4%  -23.08%  (p=0.000 n=10+10)
Encoder_Small_Sonic_StdNot      74.0µs ± 1%    54.0µs ± 1%  -26.94%  (p=0.000 n=10+10)

name                          old speed      new speed      delta
Encoder_Generic_Sonic_Std      265MB/s ± 2%   279MB/s ± 1%   +5.20%  (p=0.000 n=9+9)
Encoder_Generic_Sonic_StdNot   398MB/s ± 2%   451MB/s ± 1%  +13.32%  (p=0.000 n=10+7)
Encoder_Escaped_Sonic_StdNot  1.35GB/s ± 2%  1.59GB/s ± 6%  +17.55%  (p=0.000 n=10+10)
Encoder_Binding_Sonic_Std     1.57GB/s ± 3%  1.90GB/s ± 3%  +20.95%  (p=0.000 n=10+10)
Encoder_Binding_Sonic_StdNot  1.72GB/s ± 5%  2.24GB/s ± 3%  +29.94%  (p=0.000 n=10+10)
Encoder_Small_Sonic_StdNot     328MB/s ± 1%   450MB/s ± 1%  +36.88%  (p=0.000 n=10+10)

name           old time/op    new time/op    delta
EncodeLoad-16    12.4µs ± 8%     9.2µs ± 5%  -26.13%  (p=0.000 n=10+10)
EncodeLoad-16  1.05GB/s ± 7%  1.42GB/s ± 5%  +35.30%  (p=0.000 n=10+10)
EncodeLoad-16    9.48kB ± 0%    9.48kB ± 0%     ~     (p=0.087 n=10+10)

@liuq19 liuq19 force-pushed the opt/quote branch 3 times, most recently from bac773b to b502dac Compare May 27, 2022 10:05
Change-Id: I3f41218187597126ef960eab09c6fa6fe252f347
@liuq19 liuq19 changed the title opt: remove most bound check in quote opt: remove bound and loop Jun 8, 2022
@liuq19 liuq19 changed the title opt: remove bound and loop opt: remove bound and loop unrolling in quote Jun 8, 2022
@liuq19 liuq19 changed the title opt: remove bound and loop unrolling in quote opt: remove bound and loop unrolling in quote (begin to use clang13) Jun 8, 2022
@AsterDY AsterDY merged commit 410625c into main Jun 8, 2022
@AsterDY AsterDY deleted the opt/quote branch June 8, 2022 13:50
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

2 participants