Inner workings of yaml-cpp vs c++ maps -


just quick question inner workings of yaml-cpp.

i noticed when tried key didn't exist got error such as:

yaml-cpp: error @ line 0, column 0: bad conversion 

i suprised because have assumed point post loading operating directly off in memory map

if lookup such as

string foo = myyaml["bar"]["foo"].as<string>(); 

does happen efficiently if had typed map. more efficient if preprocess things know exist in yaml c++ map , access them directly rather via node?

i guess i'm asking if perf of map faster acessing node

thanks

lookup in map in yaml-cpp o(n) - loops through entries in map. see this issue on project page.

lookup in std::map o(log n) - stores keys in order, , binary searches find key. if have large number of keys, might faster preprocess data. should measure first :)


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -