MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / BuildBenchmarkConfigs

Function BuildBenchmarkConfigs

src/benchmark/Performance.cpp:421–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421std::vector<BenchmarkConfig> BuildBenchmarkConfigs(
422 const std::vector<std::string>& config_names) {
423 std::vector<BenchmarkConfig> configs;
424 configs.reserve(config_names.size() * 2);
425 for (const std::string& config_name : config_names) {
426 const std::string source_path = ResolveConfigPath(config_name);
427 configs.push_back(BenchmarkConfig{config_name + "/ocd2", source_path});
428 try {
429 configs.push_back(BenchmarkConfig{
430 config_name + "/text_json",
431 GetTemporaryTextConfigRegistry().Create(source_path, "text",
432 "benchmark-text"),
433 });
434 } catch (const FileNotFound&) {
435 // Some legacy benchmark configs only ship precompiled ocd2 artifacts.
436 // Skip the text-json variant when there is no source text dictionary.
437 }
438 }
439 return configs;
440}
441
442std::string QuotePath(const std::string& path) {
443 return "\"" + path + "\"";

Callers 1

RegisterBenchmarksFunction · 0.85

Calls 5

ResolveConfigPathFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected