summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-08-17 08:15:57 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-08-17 08:15:57 -0700
commitfa82e4fbf065bb474b0f87023f66edffb8a5b850 (patch)
treee515ba7d9a431a05b08468619b8289d7bc9b1527 /benchmarks
parent51d4e295a4d8e55facf0e95502cde75d488fd511 (diff)
Benchmark JIT vs no JIT without forcing a whole-project recompile.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/parsestream.upb.c (renamed from benchmarks/parsestream.upb_table.c)1
-rw-r--r--benchmarks/parsetostruct.upb.c (renamed from benchmarks/parsetostruct.upb_table.c)6
2 files changed, 6 insertions, 1 deletions
diff --git a/benchmarks/parsestream.upb_table.c b/benchmarks/parsestream.upb.c
index a4022b1..37ccb42 100644
--- a/benchmarks/parsestream.upb_table.c
+++ b/benchmarks/parsestream.upb.c
@@ -52,6 +52,7 @@ static bool initialize()
}
upb_handlers *handlers = upb_handlers_new();
+ if (!JIT) handlers->should_jit = false;
// Cause all messages to be read, but do nothing when they are.
upb_handlerset hset = {NULL, NULL, value, startsubmsg, NULL, NULL, NULL};
upb_handlers_reghandlerset(handlers, def, &hset);
diff --git a/benchmarks/parsetostruct.upb_table.c b/benchmarks/parsetostruct.upb.c
index 88f355d..a436fd4 100644
--- a/benchmarks/parsetostruct.upb_table.c
+++ b/benchmarks/parsetostruct.upb.c
@@ -42,7 +42,11 @@ static bool initialize()
upb_stringsrc_init(&strsrc);
upb_stringsrc_reset(&strsrc, str, len);
- upb_decoder_initformsgdef(&d, def);
+ upb_handlers *h = upb_handlers_new();
+ upb_accessors_reghandlers(h, def);
+ if (!JIT) h->should_jit = false;
+ upb_decoder_initforhandlers(&d, h);
+ upb_handlers_unref(h);
if (!BYREF) {
// TODO: use byref/byval accessors.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback