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

Function BenchmarkGroupName

src/benchmark/Performance.cpp:596–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596std::string BenchmarkGroupName(const benchmark::BenchmarkReporter::Run& run) {
597 const std::string name = run.benchmark_name();
598 const std::string::size_type slash_pos = name.find('/');
599 const std::string prefix =
600 slash_pos == std::string::npos ? name : name.substr(0, slash_pos);
601 if (prefix == "BM_Initialization") {
602 return "Initialization";
603 }
604 if (prefix == "BM_ConvertLongText") {
605 return "Convert Long Text";
606 }
607 if (prefix == "BM_Convert") {
608 return "Convert";
609 }
610 if (prefix == "BM_CommandLineLongText") {
611 return "Command Line Long Text";
612 }
613 if (prefix == "BM_CommandLine") {
614 return "Command Line";
615 }
616 return prefix;
617}
618
619bool SameCounterNames(const benchmark::UserCounters& lhs,
620 const benchmark::UserCounters& rhs) {

Callers 1

ReportRunsMethod · 0.85

Calls 3

benchmark_nameMethod · 0.80
findMethod · 0.80
substrMethod · 0.45

Tested by

no test coverage detected