From 6f6a2937bfcb69a1ba74e8b5736c34ca915c4863 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 27 Feb 2011 11:56:41 -0800 Subject: Make proto2 benchmarks use ParsePartial, to make results vs upb more comparable. ParsePartial does not check that required fields are set, which upb also currently does not do. This sped up proto2 reflection by 40%, but upb is still 7x faster in a comparable test (instead of 11x, like before). --- benchmarks/parsetostruct.proto2_compiled.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'benchmarks/parsetostruct.proto2_compiled.cc') diff --git a/benchmarks/parsetostruct.proto2_compiled.cc b/benchmarks/parsetostruct.proto2_compiled.cc index f5f02bf..5b7c18e 100644 --- a/benchmarks/parsetostruct.proto2_compiled.cc +++ b/benchmarks/parsetostruct.proto2_compiled.cc @@ -29,7 +29,7 @@ static void cleanup() static size_t run(int i) { - if(!msg[i%NUM_MESSAGES].ParseFromString(str)) { + if(!msg[i%NUM_MESSAGES].ParsePartialFromString(str)) { fprintf(stderr, "Error parsing with proto2.\n"); return 0; } -- cgit v1.2.3