MCPcopy Create free account
hub / github.com/Snapchat/Valdi / RegularStringComparison

Function RegularStringComparison

valdi/test/benchmark/string_benchmark.cpp:37–47  ·  view source on GitHub ↗

How long does it take to compare regular std::strings Used as base

Source from the content-addressed store, hash-verified

35// How long does it take to compare regular std::strings
36// Used as base
37static void RegularStringComparison(benchmark::State& state) {
38 auto strings = makeRandomStrings(state.range(0));
39
40 for (auto _ : state) {
41 for (const auto& str : strings) {
42 for (const auto& other : strings) {
43 benchmark::DoNotOptimize(str == other);
44 }
45 }
46 }
47}
48BENCHMARK(RegularStringComparison)->Range(8, 512);
49
50// How long does it take to compare StringBox objects

Callers

nothing calls this directly

Calls 1

makeRandomStringsFunction · 0.85

Tested by

no test coverage detected