summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2011-08-19 19:16:10 -0700
committerJosh Haberman <jhaberman@gmail.com>2011-08-19 19:16:10 -0700
commita090a7abf62392a094a99c3fcc1d0cd35b4f4672 (patch)
tree34d780b40c9aa0c36d07dfc6fd01c4b56ecd5123
parent06b8181f975d66341fe8b96999c911a8ed24447c (diff)
Fix proto2 benchmark for newer proto2.
-rw-r--r--Makefile10
-rw-r--r--benchmarks/parsetoproto2.upb.cc3
2 files changed, 6 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index f413ca2..ca04d71 100644
--- a/Makefile
+++ b/Makefile
@@ -289,7 +289,9 @@ UPB_BENCHMARKS += \
benchmarks/b.parsestream_googlemessage1.upb_jit \
benchmarks/b.parsestream_googlemessage2.upb_jit \
benchmarks/b.parsetostruct_googlemessage1.upb_jit_byval \
- benchmarks/b.parsetostruct_googlemessage2.upb_jit_byval
+ benchmarks/b.parsetostruct_googlemessage2.upb_jit_byval \
+ benchmarks/b.parsetoproto2_googlemessage1.upb_jit \
+ benchmarks/b.parsetoproto2_googlemessage2.upb_jit
endif
BENCHMARKS=$(UPB_BENCHMARKS) \
@@ -300,12 +302,6 @@ BENCHMARKS=$(UPB_BENCHMARKS) \
benchmarks/b.parsetoproto2_googlemessage1.upb \
benchmarks/b.parsetoproto2_googlemessage2.upb
-ifdef USE_JIT
-BENCHMARKS += \
- benchmarks/b.parsetoproto2_googlemessage1.upb_jit \
- benchmarks/b.parsetoproto2_googlemessage2.upb_jit
-endif
-
upb_benchmarks: $(UPB_BENCHMARKS)
benchmarks: $(BENCHMARKS)
benchmark:
diff --git a/benchmarks/parsetoproto2.upb.cc b/benchmarks/parsetoproto2.upb.cc
index e60c5d5..af3e1f2 100644
--- a/benchmarks/parsetoproto2.upb.cc
+++ b/benchmarks/parsetoproto2.upb.cc
@@ -86,6 +86,9 @@ class UpbRepeatedPtrField : public google::protobuf::internal::RepeatedPtrFieldB
class TypeHandler {
public:
typedef void Type;
+ // AddAllocated() calls this, but only if other objects are sitting
+ // around waiting for reuse, which we will not do.
+ static void Delete(Type*) { assert(false); }
};
void *Add(google::protobuf::Message *m) {
void *submsg = RepeatedPtrFieldBase::AddFromCleared<TypeHandler>();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback