summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-27 11:56:41 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-27 11:56:41 -0800
commit6f6a2937bfcb69a1ba74e8b5736c34ca915c4863 (patch)
tree43759c6b53fdac40d5c8c83270e74a53756cdc52 /benchmarks
parent65b57a281390310f0097cbdb9d7967d97f94679c (diff)
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).
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/parsetostruct.proto2_compiled.cc2
-rw-r--r--benchmarks/parsetostruct.proto2_table.cc2
2 files changed, 2 insertions, 2 deletions
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;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback