Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

move semantics for the buffer inside mapnik.VectorTile #881

Closed
springmeyer opened this issue Jun 22, 2018 · 3 comments
Closed

move semantics for the buffer inside mapnik.VectorTile #881

springmeyer opened this issue Jun 22, 2018 · 3 comments

Comments

@springmeyer
Copy link
Member

The getData() call copies the entire, uncompressed, vector tile buffer. This can be expensive.

We should add support for a takeData() or release() function which returns a node.Buffer which owns the underlying memory (the original mapnik.VectorTile object would then be empty).

This will allow for much more efficient passing of data to other node C++ addons like https://github.com/mapbox/vtcomposite and https://github.com/mapbox/vtquery.

/cc @mapbox/core-tech @flippmoke

refs mapbox/node-cpp-skel#69 and mapbox/node-cpp-skel#67

@springmeyer springmeyer added this to the v3.7.3 milestone Jun 22, 2018
@springmeyer
Copy link
Member Author

springmeyer commented Jun 25, 2018

I've decided not to move ahead with this. I was assuming that the buffer type stored on the node-mapnik object and would be easy to change into a std::unique_ptr<std::string> to allow passing ownership around. But, it turns out the underlying type of the buffer is a std::string very deep inside mapnik-vector-tile. I'm therefore reluctant to change this given the greater time expensive to modifying both libraries. So, I'm punting on this and will plan to unlock the efficiency need I have by completely avoiding node-mapnik usage over at mapbox/tilelive-vector#155

@flippmoke
Copy link
Member

flippmoke commented Jun 27, 2018

Took a shot at this with #889 and mapbox/mapnik-vector-tile#285

@springmeyer springmeyer modified the milestones: v3.7.3, 4.0.1 Jun 29, 2018
@flippmoke
Copy link
Member

Released in 4.0.1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants