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

Function EncodeValdiProtobuf

valdi_protobuf/src/benchmark/Benchmark.cpp:135–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133BENCHMARK(DecodeValdiProtobufNoPostprocess);
134
135static void EncodeValdiProtobuf(benchmark::State& state) {
136 auto protoData = makeProtoData();
137 const auto* descriptor = test::Message::GetDescriptor();
138 auto result = Protobuf::Message::parse(protoData, descriptor);
139 if (!result) {
140 SC_ABORT("Message failed to parse");
141 }
142 auto message = result.moveValue();
143
144 for (auto _ : state) {
145 benchmark::DoNotOptimize(message->encode());
146 }
147}
148BENCHMARK(EncodeValdiProtobuf);
149
150BENCHMARK_MAIN();

Callers

nothing calls this directly

Calls 4

makeProtoDataFunction · 0.85
GetDescriptorFunction · 0.85
encodeMethod · 0.65
parseFunction · 0.50

Tested by

no test coverage detected