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

feat: improve string encoding #9

Merged
merged 3 commits into from
Jan 12, 2022

Conversation

tdakkota
Copy link
Member

Benchstat result:

name                           old time/op    new time/op    delta
EncoderBigObject-12              7.56µs ± 2%    4.01µs ± 1%  -46.97%  (p=0.000 n=10+10)
Encoder_Field/1/Manual-12        20.6ns ± 2%    18.6ns ± 0%   -9.83%  (p=0.000 n=10+9)
Encoder_Field/1/Callback-12      26.2ns ± 5%    24.8ns ± 5%   -5.20%  (p=0.034 n=10+10)
Encoder_Field/5/Manual-12        84.3ns ± 1%    81.9ns ± 0%   -2.89%  (p=0.000 n=10+9)
Encoder_Field/5/Callback-12       112ns ± 4%     126ns ± 1%  +12.43%  (p=0.000 n=10+10)
Encoder_Field/10/Manual-12        173ns ± 1%     150ns ± 0%  -13.15%  (p=0.000 n=10+9)
Encoder_Field/10/Callback-12      200ns ± 2%     182ns ± 1%   -9.30%  (p=0.000 n=9+10)
Encoder_Field/100/Manual-12      1.62µs ± 1%    1.39µs ± 0%  -13.91%  (p=0.000 n=10+9)
Encoder_Field/100/Callback-12    1.86µs ± 1%    1.65µs ± 0%  -11.15%  (p=0.000 n=10+10)

name                           old speed      new speed      delta
EncoderBigObject-12             674MB/s ± 2%  1271MB/s ± 1%  +88.57%  (p=0.000 n=10+10)

Benchstat result:
```
EncoderBigObject-12              7.56µs ± 2%    4.01µs ± 1%  -46.97%  (p=0.000 n=10+10)
Encoder_Field/1/Manual-12        20.6ns ± 2%    18.6ns ± 0%   -9.83%  (p=0.000 n=10+9)
Encoder_Field/1/Callback-12      26.2ns ± 5%    24.8ns ± 5%   -5.20%  (p=0.034 n=10+10)
Encoder_Field/5/Manual-12        84.3ns ± 1%    81.9ns ± 0%   -2.89%  (p=0.000 n=10+9)
Encoder_Field/5/Callback-12       112ns ± 4%     126ns ± 1%  +12.43%  (p=0.000 n=10+10)
Encoder_Field/10/Manual-12        173ns ± 1%     150ns ± 0%  -13.15%  (p=0.000 n=10+9)
Encoder_Field/10/Callback-12      200ns ± 2%     182ns ± 1%   -9.30%  (p=0.000 n=9+10)
Encoder_Field/100/Manual-12      1.62µs ± 1%    1.39µs ± 0%  -13.91%  (p=0.000 n=10+9)
Encoder_Field/100/Callback-12    1.86µs ± 1%    1.65µs ± 0%  -11.15%  (p=0.000 n=10+10)

name                           old speed      new speed      delta
EncoderBigObject-12             674MB/s ± 2%  1271MB/s ± 1%  +88.57%  (p=0.000 n=10+10)
```
@codecov
Copy link

codecov bot commented Jan 11, 2022

Codecov Report

Merging #9 (155802f) into main (d76a769) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main        #9   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         1871      1872    +1     
=========================================
+ Hits          1871      1872    +1     
Impacted Files Coverage Δ
enc_str.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d76a769...155802f. Read the comment docs.

@tdakkota tdakkota marked this pull request as draft January 11, 2022 14:12
@tdakkota tdakkota force-pushed the feat/improve-fast-str-encoding branch from f08fdf7 to 155802f Compare January 11, 2022 14:34
@ernado
Copy link
Member

ernado commented Jan 11, 2022

name                           old time/op    new time/op    delta
EncoderBigObject-32              5.89µs ± 2%    3.51µs ± 2%  -40.43%  (p=0.000 n=9+9)
Encoder_Field/1/Manual-32        16.0ns ± 2%    16.8ns ± 3%   +4.63%  (p=0.000 n=9+9)
Encoder_Field/1/Callback-32      21.0ns ± 3%    20.9ns ± 5%     ~     (p=0.593 n=10+10)
Encoder_Field/5/Manual-32        68.9ns ± 2%    65.3ns ± 2%   -5.32%  (p=0.000 n=10+10)
Encoder_Field/5/Callback-32      79.2ns ± 4%    78.5ns ± 1%     ~     (p=0.633 n=10+8)
Encoder_Field/10/Manual-32        143ns ± 2%     133ns ± 4%   -6.92%  (p=0.000 n=10+10)
Encoder_Field/10/Callback-32      162ns ± 4%     157ns ± 2%   -3.18%  (p=0.001 n=9+9)
Encoder_Field/100/Manual-32      1.33µs ± 2%    1.22µs ± 3%   -7.89%  (p=0.000 n=10+10)
Encoder_Field/100/Callback-32    1.49µs ± 5%    1.44µs ± 3%   -3.24%  (p=0.005 n=10+10)

name                           old speed      new speed      delta
EncoderBigObject-32             864MB/s ± 2%  1451MB/s ± 2%  +67.87%  (p=0.000 n=9+9)
name            old time/op    new time/op    delta
OTEL_Encode-32     596ns ±12%     390ns ± 3%  -34.56%  (p=0.008 n=5+5)

name            old speed      new speed      delta
OTEL_Encode-32   716MB/s ±12%  1087MB/s ± 3%  +51.75%  (p=0.008 n=5+5)

@tdakkota tdakkota marked this pull request as ready for review January 12, 2022 06:39
@ernado ernado merged commit e59755e into go-faster:main Jan 12, 2022
@tdakkota tdakkota deleted the feat/improve-fast-str-encoding branch January 12, 2022 09:20
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