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, createArrayBuffer
instances for all socket reads and emit slices of thoseArrayBuffer
s to JS.
Checklist
-
make -j4 test
(UNIX), orvcbuild 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