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

Tests and documentation for vtzero::key_index/value_index #17

Closed
springmeyer opened this issue Oct 31, 2017 · 1 comment
Closed

Tests and documentation for vtzero::key_index/value_index #17

springmeyer opened this issue Oct 31, 2017 · 1 comment

Comments

@springmeyer
Copy link
Contributor

springmeyer commented Oct 31, 2017

@joto - I noticed that you are working on a more flexible way to control how the tables are built for keys and values during the building of a new vector tile.

The new interface I notice in https://github.com/mapbox/vtzero/blob/master/include/vtzero/index.hpp looks powerful - the idea of allowing the programmer to control whether a std::map or std::unordered_map (or something else like a sso optimized map - https://github.com/greg7mdp/sho) is used it excellent.

I'd like to put a request in to prioritize this code for documentation and tests because I anticipate that @GretaCB and I will want to use it, and benchmark plugging in different containers.

Currently in our code I'm seeing that the default implementation (which appears to iterate the protobuf data each time a key/value is added?) is a bottleneck. So I'm hoping a hashmap will be faster:

screen shot 2017-10-31 at 3 32 56 pm

refs

static index_value find_in_table(const data_view text, const std::string& data) {
uint32_t index = 0;
protozero::pbf_message<detail::pbf_layer> pbf_table{data};
while (pbf_table.next()) {
const auto v = pbf_table.get_view();
if (v == text) {
return index_value{index};
}
++index;
}
return index_value{};
}

This was referenced Nov 6, 2017
Closed
@springmeyer
Copy link
Contributor Author

done in d90bb18, thank you @joto

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

No branches or pull requests

1 participant