The current mechanism returns a pointer to the embedded data and its size. Passing it into V8 forces us to load the entire embedded data into a buffer in memory. It is not efficient to prematurely store the entire payload in memory, especially if the payload is huge.
Problem
The current mechanism returns a pointer to the embedded data and its size. Passing it into V8 forces us to load the entire embedded data into a buffer in memory. It is not efficient to prematurely store the entire payload in memory, especially if the payload is huge.
See https://github.com/nodejs/node/pull/42334#issuecomment-1184718946.
Suggested solution
If the Postject Api returns the file offset of the embedded data, we will be able to parse only the parts that we are interested in.