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

Function SetCommandLineCounters

src/benchmark/Performance.cpp:740–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738}
739
740void SetCommandLineCounters(benchmark::State& state, size_t total_input_bytes,
741 double total_load_ms, double total_convert_ms,
742 double total_write_ms, double total_total_ms) {
743 const double throughput =
744 total_total_ms > 0.0
745 ? (static_cast<double>(total_input_bytes) / 1000000.0) /
746 (total_total_ms / 1000.0)
747 : 0.0;
748 const double iterations = static_cast<double>(state.iterations());
749 state.counters["Throughput"] = benchmark::Counter(throughput);
750 state.counters["LoadMs"] = benchmark::Counter(total_load_ms / iterations);
751 state.counters["ConvertMs"] =
752 benchmark::Counter(total_convert_ms / iterations);
753 state.counters["WriteMs"] = benchmark::Counter(total_write_ms / iterations);
754 state.counters["TotalMs"] = benchmark::Counter(total_total_ms / iterations);
755}
756
757std::string ReadText(const std::string& filename) {
758 const std::string benchmark_data_dir = PROJECT_SOURCE_DIR "/test/benchmark/";

Callers 2

BM_CommandLineLongTextFunction · 0.85
BM_CommandLineFunction · 0.85

Calls 2

iterationsMethod · 0.80
CounterClass · 0.50

Tested by

no test coverage detected