optimize protobuf serializer