What is the time complexity of using boost property tree's get_child_optional method? How fast or slow is it as compared to std::unordered_map lookup if we store node name and property_tree as KV pair?
No doc found for the same
What is the time complexity of using boost property tree's get_child_optional method? How fast or slow is it as compared to std::unordered_map lookup if we store node name and property_tree as KV pair?
No doc found for the same
It calls
walk_path()to do most of the work, which is hereBut what about that
find()? It is on a Boost Multi-Index container, and thatordered_non_uniquetype is documented hereSo in total it is O(n log m): linear time in the number of path components n you pass to
get_child_optional(), and logarithmic time in the number of children m at each step in the recursion through the path components.You'll have to test that with your actual data to find out.