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

Improve memory use and performance of multipart parsing #745

Merged
merged 2 commits into from
Aug 31, 2021

Commits on Aug 31, 2021

  1. 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)`.
    quinnj committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    a52b672 View commit details
    Browse the repository at this point in the history
  2. Fix exporting of closewrite since Julia Base now exports it

    Also clean up usages of startread, closeread, startwrite, closewrite to
    quality to the IOExtras module. Also fix the websocket tests that were
    hanging since echo.websocket.org doesn't exist anymore. I found pie
    socket that offers a free websocket testing server if you sign up and
    get an api key, so that's been added as a repository secret now. If
    anyone wants the api key to run the tests on their local machine, I'm
    happy to share.
    quinnj committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    bbff1de View commit details
    Browse the repository at this point in the history