Skip to content

http2: refactor read mechanism

The first commit is from #18020 to avoid merge conflicts.

  • src: introduce internal buffer slice constructor

    Add a C++ variant of Buffer.from(arrayBuffer, offset, length).

  • http2: refactor read mechanism

    Refactor the read mechanism to completely avoid copying.

    Instead of copying individual DATA frame contents into buffers, create ArrayBuffer instances for all socket reads and emit slices of those ArrayBuffers to JS.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included (note that the added test passes independently of this change)
  • commit message follows commit guidelines
Affected core subsystem(s)

/cc @nodejs/http2

Merge request reports

Loading