MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / regitser_OnDemand

Function regitser_OnDemand

benchmark/main.cpp:176–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176static void regitser_OnDemand() {
177 std::vector<OnDemand> tests = {
178 {"twitter", "Normal", {"search_metadata", "count"}, 100, true},
179 {"citm_catalog",
180 "Fronter",
181 {"events", "342742596", "id"},
182 342742596,
183 true},
184 {"twitter", "NotFound", {"NotFound"}},
185 };
186
187 for (auto &t : tests) {
188 auto file_path = std::string("testdata/") + t.file + ".json";
189 t.json = get_json(file_path);
190
191#define REG_ONDEMAND(JSON) \
192 { \
193 auto name = \
194 std::string(t.file) + ("/" #JSON "OnDemand") + "_" + t.name.c_str(); \
195 benchmark::RegisterBenchmark(name.c_str(), BM_##JSON##OnDemand, t); \
196 }
197 REG_ONDEMAND(Sonic);
198 REG_ONDEMAND(RapidjsonSax);
199 REG_ONDEMAND(SIMDjson);
200 }
201}
202
203int main(int argc, char **argv) {
204 benchmark::Initialize(&argc, argv);

Callers 1

mainFunction · 0.85

Calls 1

get_jsonFunction · 0.70

Tested by

no test coverage detected