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

[Fizz] write chunks to a buffer with no re-use #24034

Merged
merged 3 commits into from
Mar 7, 2022

Commits on Mar 5, 2022

  1. write chunks to a buffer with no re-use

    chunks were previously enqueued to a ReadableStream as they were written. We now write them to a view over an ArrayBuffer
    and enqueue them only when writing has completed or the buffer's size is exceeded. In addition this copy now ensures
    we don't attempt to re-send buffers that have already been transferred.
    gnoff committed Mar 5, 2022
    Configuration menu
    Copy the full SHA
    2e302f7 View commit details
    Browse the repository at this point in the history
  2. refactor writeChunk to be more defensive and efficient

    We now defend against overflows using the next views length instead of the current one. this protects us against a future where we use byobRequest and we get longer initial views than we might create after overflowing the first time. Additionally we add in an optimization when we have completely filled up the currentView where we avoid creating subarrays of the chunk to write since it lands exactly on a view boundary. Finally we move the view creation to beginWriting to avoid a runtime check on each write and because we want to reset the view on each beginWriting call in case a throw elsewhere in the program leaves the currentView in an unfinished state
    gnoff committed Mar 5, 2022
    Configuration menu
    Copy the full SHA
    3ae6dea View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2022

  1. Configuration menu
    Copy the full SHA
    2d7b743 View commit details
    Browse the repository at this point in the history