MCPcopy Create free account
hub / github.com/apache/arrow / TypeEqualsWithMetadata

Function TypeEqualsWithMetadata

cpp/src/arrow/type_benchmark.cc:76–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76static void TypeEqualsWithMetadata(
77 benchmark::State& state) { // NOLINT non-const reference
78 auto md1 = key_value_metadata({"k1", "k2"}, {"some value1", "some value2"});
79 auto md2 = key_value_metadata({"k1", "k2"}, {"some value1", "some value2"});
80 auto md3 = key_value_metadata({"k2", "k1"}, {"some value2", "some value1"});
81
82 auto fa1 = field("as", list(float16()));
83 auto fa2 = field("as", list(float16()));
84 auto fb1 = field("bs", utf8(), /*nullable=*/true, md1);
85 auto fb2 = field("bs", utf8(), /*nullable=*/true, md2);
86 auto fb3 = field("bs", utf8(), /*nullable=*/true, md3);
87
88 auto a = struct_({fa1, fb1});
89 auto b = struct_({fa2, fb2});
90 auto c = struct_({fa2, fb3});
91
92 int64_t total = 0;
93 for (auto _ : state) {
94 total += a->Equals(*b);
95 total += a->Equals(*c);
96 }
97 benchmark::DoNotOptimize(total);
98 state.SetItemsProcessed(state.iterations() * 2);
99}
100
101static std::vector<std::shared_ptr<Schema>> SampleSchemas() {
102 auto fa1 = field("as", list(float16()));

Callers

nothing calls this directly

Calls 5

key_value_metadataFunction · 0.85
listFunction · 0.85
struct_Function · 0.85
fieldFunction · 0.70
EqualsMethod · 0.45

Tested by

no test coverage detected