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

Function SchemaEqualsWithMetadata

cpp/src/arrow/type_benchmark.cc:148–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148static void SchemaEqualsWithMetadata(
149 benchmark::State& state) { // NOLINT non-const reference
150 auto schemas = SampleSchemas();
151
152 auto schema1 = schemas[0];
153 auto schema2 = schemas[1];
154 auto schema3 = schemas[2];
155
156 auto md1 = key_value_metadata({"k1", "k2"}, {"some value1", "some value2"});
157 auto md2 = key_value_metadata({"k1", "k2"}, {"some value1", "some value2"});
158 auto md3 = key_value_metadata({"k2", "k1"}, {"some value2", "some value1"});
159
160 schema1 = schema1->WithMetadata(md1);
161 schema2 = schema1->WithMetadata(md2);
162 schema3 = schema1->WithMetadata(md3);
163
164 int64_t total = 0;
165 for (auto _ : state) {
166 total += schema1->Equals(*schema2);
167 total += schema1->Equals(*schema3);
168 }
169 benchmark::DoNotOptimize(total);
170 state.SetItemsProcessed(state.iterations() * 2);
171}
172
173// ------------------------------------------------------------------------
174// Micro-benchmark various error reporting schemes

Callers

nothing calls this directly

Calls 4

SampleSchemasFunction · 0.85
key_value_metadataFunction · 0.85
WithMetadataMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected