-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve memory use and performance of multipart parsing
Memory usage and performance noted in https://discourse.julialang.org/t/http-parse-multipart-form-does-a-lot-of-memory-allocations/66661. This uses some of the same regex tricks we use in the other http parsing code that operates on SubStrings and avoids excessive allocations. We also streamline things to avoid allocating when comparing byte buffers and the unnecessary allocated arrays of the content disposition processing. On my machine for current master, I see `35.022 μs (866 allocations: 70.27 KiB)` for parsing a simple multipart request from the tests, and with this PR, I see `3.603 μs (42 allocations: 2.55 KiB)`.
- Loading branch information
Showing
3 changed files
with
101 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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