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 +- benchmarks/parsetostruct.proto2_table.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'benchmarks') 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; } diff --git a/benchmarks/parsetostruct.proto2_table.cc b/benchmarks/parsetostruct.proto2_table.cc index 49a5b16..83546ae 100644 --- a/benchmarks/parsetostruct.proto2_table.cc +++ b/benchmarks/parsetostruct.proto2_table.cc @@ -38,7 +38,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