MCPcopy Create free account
hub / github.com/ashvardanian/less_slow.cpp / errors_variants

Function errors_variants

less_slow.cpp:6218–6232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6216}
6217
6218static void errors_variants(bm::State &state) {
6219 std::string const filename = "test.txt";
6220 std::size_t iteration_index = 0;
6221 for (auto _ : state) {
6222 iteration_index++;
6223 auto read_result = read_integer_from_file_or_variants(filename, iteration_index);
6224 if (!read_result) continue;
6225 auto integer_result = string_to_integer_or_variants(read_result.value(), iteration_index);
6226 if (!integer_result) continue;
6227 auto next_result = integer_to_next_string_or_variants(integer_result.value(), iteration_index);
6228 if (!next_result) continue;
6229 auto write_error = write_to_file_or_variants(filename, next_result.value(), iteration_index);
6230 bm::DoNotOptimize(write_error);
6231 }
6232}
6233
6234BENCHMARK(errors_variants)->ComputeStatistics("max", get_max_value)->MinTime(2);
6235BENCHMARK(errors_variants)->ComputeStatistics("max", get_max_value)->MinTime(2)->Threads(physical_cores());

Callers

nothing calls this directly

Tested by

no test coverage detected