#include #include #include #include #include using namespace Upp; CONSOLE_APP_MAIN { StdLogSetup(LOG_COUT|LOG_FILE); Vector w = AliceWords(); std::vector q; for(auto s : w) q.push_back(s.ToStd()); for(int i = 0; i < 100; i++) { Index ndx; std::set st; std::set hst; { RTIMING("Index"); for(const String& s : w) ndx.FindAdd(s); } { RTIMING("set"); for(const std::string& s : q) st.insert(s); } { RTIMING("unordered_set"); for(const std::string& s : q) hst.insert(s); } ONCELOCK { RDUMP(ndx.GetCount()); RDUMP(st.size()); RDUMP(hst.size()); } } }