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

Don't allocate buffer twice #1403

Merged
merged 3 commits into from Sep 14, 2020
Merged

Don't allocate buffer twice #1403

merged 3 commits into from Sep 14, 2020

Commits on Aug 11, 2020

  1. Don't allocate buffer twice

    * getBuffer returns a buffer of concatenated response chunks.
    * Its result is stored in rawBody and passed to parseBody.
    * Then it meets Buffer.from(rawBody) and triggers a new buffer allocation:
       https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_buffer
    
    Now a new Buffer created without copying the underlying memory.
    https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length
    xamgore committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    8be0890 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2020

  1. Update parse-body.ts

    szmarczak committed Sep 13, 2020
    Configuration menu
    Copy the full SHA
    cc71176 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2020

  1. Update readme.md

    szmarczak committed Sep 14, 2020
    Configuration menu
    Copy the full SHA
    fb66b94 View commit details
    Browse the repository at this point in the history