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

Function BM_Convert

src/benchmark/Performance.cpp:785–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785static void BM_Convert(benchmark::State& state, const BenchmarkConfig& config,
786 int iteration) {
787 std::ostringstream os;
788 for (int i = 0; i < iteration; i++) {
789 os << "Open Chinese Convert 開放中文轉換" << i << std::endl;
790 }
791 const std::string text = os.str();
792 const std::unique_ptr<SimpleConverter> converter(Initialize(config));
793 for (auto _ : state) {
794 Convert(converter.get(), text);
795 }
796 SetThroughputCounter(state, text.size());
797}
798
799static void BM_CommandLineLongText(benchmark::State& state,
800 const BenchmarkConfig& config) {

Callers 1

RegisterBenchmarksFunction · 0.85

Calls 6

ConvertFunction · 0.85
SetThroughputCounterFunction · 0.85
InitializeFunction · 0.70
strMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected