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

Optimize passing protobuf message back from threadpool #145

Open
springmeyer opened this issue Nov 22, 2017 · 0 comments
Open

Optimize passing protobuf message back from threadpool #145

springmeyer opened this issue Nov 22, 2017 · 0 comments

Comments

@springmeyer
Copy link
Contributor

The AfterRange function currently calls Nan::CopyBuffer which creates a copy of the entire protobuf string before passing the back to JS.

We can optimize this by using the signature of Nan::NewBuffer that will take ownership of the string rather than copying it, to allow zero-copy passing of data from C++ to JS.

This method can be described at mapbox/node-cpp-skel#69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants