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

Refactor RequestBodyReader #1826

Merged
merged 1 commit into from
Sep 4, 2023
Merged

Refactor RequestBodyReader #1826

merged 1 commit into from
Sep 4, 2023

Conversation

jwoertink
Copy link
Member

Purpose

Fixes #1825

Description

The original implementation of this was a bit difficult to read and understand. This is just a refactor to make the intention of the method a little easier to comprehend. Added some docs.

Also ran some benchmarks and this way is slightly faster:

old  11.59k ( 86.27µs) (± 1.24%)  578kB/op   1.45× slower
new  16.75k ( 59.70µs) (± 0.75%)  406kB/op        fastest

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

@jwoertink jwoertink merged commit 3f15bc8 into main Sep 4, 2023
4 of 5 checks passed
@jwoertink jwoertink deleted the issues/1825 branch September 4, 2023 17:46
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.

The RequestBodyReader could use a refactor
1 participant