Speed up http client#633
Merged
arnetheduck merged 1 commit intomasterfrom Apr 7, 2026
Merged
Conversation
The http client currently uses an inefficient byte-by-byte copy in its `BoundedStreamReader` - the real solution here is to get rid of the copy completely but until then, we can use bulk-copy the data at least. Ditto `read`, `readN` and similar helpers - this ~doubles throughput for bulk reading. Pre: ``` | Small/small | 0.070s | 1000 | 14226.009 | 0.031 MB | 0.016 MB | 0.434 MB/s | 0.231 MB/s | | Medium/small | 1.834s | 1000 | 545.267 | 1000.000 MB | 0.021 MB | 545.267 MB/s | 0.011 MB/s | | Small/Medium | 2.238s | 1000 | 446.735 | 0.031 MB | 1000.000 MB | 0.014 MB/s | 446.735 MB/s | | Medium/Medium | 2.583s | 1000 | 387.196 | 1000.000 MB | 1000.000 MB | 387.196 MB/s | 387.196 MB/s | ``` Post: ``` | Small/small | 0.066s | 1000 | 15038.890 | 0.031 MB | 0.016 MB | 0.459 MB/s | 0.244 MB/s | | Medium/small | 0.954s | 1000 | 1048.475 | 1000.000 MB | 0.021 MB | 1048.475 MB/s | 0.022 MB/s | | Small/Medium | 1.264s | 1000 | 791.318 | 0.031 MB | 1000.000 MB | 0.024 MB/s | 791.318 MB/s | | Medium/Medium | 1.615s | 1000 | 619.083 | 1000.000 MB | 1000.000 MB | 619.083 MB/s | 619.083 MB/s | ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The http client currently uses an inefficient byte-by-byte copy in its
BoundedStreamReader- the real solution here is to get rid of the copy completely but until then, we can use bulk-copy the data at least.Ditto
read,readNand similar helpers - this ~doubles throughput for bulk reading.Pre:
Post: