-
Notifications
You must be signed in to change notification settings - Fork 322
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
Reduce allocations in flate decompressor and minor code improvements #869
Reduce allocations in flate decompressor and minor code improvements #869
Commits on Oct 8, 2023
-
made f.step an enum instead of func pointer
according to my local benchmarks, it doesn't affect throughtput anyhow, but leaves constant 1 allocation/op in decompressor benchmarks
Configuration menu - View commit details
-
Copy full SHA for 6a1c1c6 - Browse repository at this point
Copy the full SHA 6a1c1c6View commit details -
removed useless array-to-slice conversion
this conversion doesn't do anything, and removing it doesn't fail any of the tests
Configuration menu - View commit details
-
Copy full SHA for 1203209 - Browse repository at this point
Copy the full SHA 1203209View commit details -
made benchmarks more accurate by removing io.Copy call
as io.Copy is just an alias for io.CopyBuffer, but passing nil instead of the actual buffer, it is being allocated internally. So better to pass it manually
Configuration menu - View commit details
-
Copy full SHA for a4773a9 - Browse repository at this point
Copy the full SHA a4773a9View commit details -
removed useless operation of nulling the length of the slice
this operation does nothing, so remoed it
Configuration menu - View commit details
-
Copy full SHA for c127997 - Browse repository at this point
Copy the full SHA c127997View commit details -
moved b.StartTimer() to the bottom
previous variant wasn't actually adding a big misaccuracy, but better to place it anyway just before a benchmarking code
Configuration menu - View commit details
-
Copy full SHA for 98e21c7 - Browse repository at this point
Copy the full SHA 98e21c7View commit details -
replaced indirect decoder call with direct
instead of returning func ptr, calling the method directly. This also doesn't bring a lot of performance gains, but on microbenchmarks may be visible
Configuration menu - View commit details
-
Copy full SHA for 4c8d7a2 - Browse repository at this point
Copy the full SHA 4c8d7a2View commit details
Commits on Oct 9, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e40efbf - Browse repository at this point
Copy the full SHA e40efbfView commit details -
moved execution of next step into the dedicated method
this improves readability of the code. Also added a debug print in case next step enumeric is unrecognized. However, everything will silently fail even without this print
Configuration menu - View commit details
-
Copy full SHA for d517f8e - Browse repository at this point
Copy the full SHA d517f8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for fbb9795 - Browse repository at this point
Copy the full SHA fbb9795View commit details -
Configuration menu - View commit details
-
Copy full SHA for 863cd97 - Browse repository at this point
Copy the full SHA 863cd97View commit details -
as flate reader implements WriterTo interface, there's completely no difference what to use
Configuration menu - View commit details
-
Copy full SHA for 1248009 - Browse repository at this point
Copy the full SHA 1248009View commit details