Lookup in a map in yaml-cpp is O(n)
- it loops through all entries in the map. See this issue on the project page.
Lookup in std::map
is O(log n)
- it stores keys in order, and binary searches to find your key. So if you have a large number of keys, it might be faster to preprocess your data. But you should probably measure first :)