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: reduce float decoding allocations by using unsafe #39

Merged
merged 3 commits into from
Mar 17, 2022

Conversation

tdakkota
Copy link
Member

@tdakkota tdakkota commented Mar 16, 2022

name                           old time/op    new time/op    delta
Decoder_Float64/floats.json-4    28.6µs ± 3%    23.1µs ± 2%   -19.14%  (p=0.000 n=15+14)

name                           old alloc/op   new alloc/op   delta
Decoder_Float64/floats.json-4    2.39kB ± 0%    0.00kB       -100.00%  (p=0.000 n=15+15)

name                           old allocs/op  new allocs/op  delta
Decoder_Float64/floats.json-4       100 ± 0%         0       -100.00%  (p=0.000 n=15+15)

Fixes #26.

name                           old time/op    new time/op    delta
Decoder_Float64/floats.json-4    28.6µs ± 3%    23.1µs ± 2%   -19.14%  (p=0.000 n=15+14)

name                           old alloc/op   new alloc/op   delta
Decoder_Float64/floats.json-4    2.39kB ± 0%    0.00kB       -100.00%  (p=0.000 n=15+15)

name                           old allocs/op  new allocs/op  delta
Decoder_Float64/floats.json-4       100 ± 0%         0       -100.00%  (p=0.000 n=15+15)
@tdakkota tdakkota closed this Mar 17, 2022
@tdakkota tdakkota reopened this Mar 17, 2022
@codecov
Copy link

codecov bot commented Mar 17, 2022

Codecov Report

Merging #39 (9917dfa) into main (2233db5) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #39   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           34        35    +1     
  Lines         2304      2309    +5     
=========================================
+ Hits          2304      2309    +5     
Impacted Files Coverage Δ
dec_float.go 100.00% <ø> (ø)
dec_parse_float_unsafe.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 2233db5...9917dfa. Read the comment docs.

@ernado ernado merged commit 232c247 into go-faster:main Mar 17, 2022
@tdakkota tdakkota deleted the feat/reduce-float-allocation branch March 17, 2022 10:09
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.

perf: get rid of allocation in float decoding slow path
2 participants