| 56 | BENCHMARK(DecodeProtobufCpp); |
| 57 | |
| 58 | static void DecodeProtobufReflectionCpp(benchmark::State& state) { |
| 59 | auto protoData = makeProtoData(); |
| 60 | google::protobuf::DynamicMessageFactory factory; |
| 61 | auto* prototype = factory.GetPrototype(test::Message::GetDescriptor()); |
| 62 | |
| 63 | for (auto _ : state) { |
| 64 | auto message = prototype->New(); |
| 65 | if (!message->ParseFromArray(protoData.data(), protoData.size())) { |
| 66 | SC_ABORT("Message failed to parse"); |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | BENCHMARK(DecodeProtobufReflectionCpp); |
| 71 | |
| 72 | static void EncodeProtobufCpp(benchmark::State& state) { |
nothing calls this directly
no test coverage detected