summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-04-01 15:40:06 -0700
committerJoshua Haberman <joshua@reverberate.org>2011-04-01 15:40:06 -0700
commit9eb4d695c49a85f7f72ad68c3c31affd61fef984 (patch)
tree79b7fde57e6f31a19405688a5f9e29e3f9cf7ab2 /benchmarks
parent19517cc6f39871abf4a0705b49cfed9049ca6033 (diff)
First rough version of the JIT.
It can successfully parse SpeedMessage1. Preliminary results: 750MB/s on Core2 2.4GHz. This number is 2.5x proto2. This isn't apples-to-apples, because proto2 is parsing to a struct and we are just doing stream parsing, but for apps that are currently using proto2, this is the improvement they would see if they could move to stream-based processing. Unfortunately perf-regression-test.py is broken, and I'm not 100% sure why. It would be nice to fix it first (to ensure that there are no performance regressions for the table-based decoder) but I'm really impatient to get the JIT checked in.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/parsestream.upb_table.c16
-rw-r--r--benchmarks/parsetostruct.upb_table.c1
2 files changed, 14 insertions, 3 deletions
diff --git a/benchmarks/parsestream.upb_table.c b/benchmarks/parsestream.upb_table.c
index 89649e6..7659e1e 100644
--- a/benchmarks/parsestream.upb_table.c
+++ b/benchmarks/parsestream.upb_table.c
@@ -12,6 +12,19 @@ static upb_decoder decoder;
static upb_stringsrc stringsrc;
upb_handlers handlers;
+static upb_sflow_t startsubmsg(void *_m, upb_value fval) {
+ (void)_m;
+ (void)fval;
+ return UPB_CONTINUE_WITH(NULL);
+}
+
+static upb_flow_t value(void *closure, upb_value fval, upb_value val) {
+ (void)closure;
+ (void)fval;
+ (void)val;
+ return UPB_CONTINUE;
+}
+
static bool initialize()
{
// Initialize upb state, decode descriptor.
@@ -50,7 +63,7 @@ static bool initialize()
upb_handlers_init(&handlers, def);
// Cause all messages to be read, but do nothing when they are.
- upb_register_all(&handlers, NULL, NULL, NULL, NULL, NULL, NULL);
+ upb_register_all(&handlers, NULL, NULL, value, startsubmsg, NULL, NULL);
upb_decoder_init(&decoder, &handlers);
upb_stringsrc_init(&stringsrc);
return true;
@@ -62,7 +75,6 @@ static void cleanup()
upb_def_unref(UPB_UPCAST(def));
upb_decoder_uninit(&decoder);
upb_stringsrc_uninit(&stringsrc);
- upb_handlers_uninit(&handlers);
}
static size_t run(int i)
diff --git a/benchmarks/parsetostruct.upb_table.c b/benchmarks/parsetostruct.upb_table.c
index e778bc5..397f964 100644
--- a/benchmarks/parsetostruct.upb_table.c
+++ b/benchmarks/parsetostruct.upb_table.c
@@ -78,7 +78,6 @@ static void cleanup()
upb_def_unref(UPB_UPCAST(def));
upb_stringsrc_uninit(&strsrc);
upb_decoder_uninit(&d);
- upb_handlers_uninit(&h);
}
static size_t run(int i)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback