summaryrefslogtreecommitdiff
path: root/src/upb_msg.c
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 /src/upb_msg.c
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 'src/upb_msg.c')
-rw-r--r--src/upb_msg.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/upb_msg.c b/src/upb_msg.c
index 6fc321e..aac2c91 100644
--- a/src/upb_msg.c
+++ b/src/upb_msg.c
@@ -299,6 +299,13 @@ upb_msg *upb_msg_appendmsg(upb_msg *msg, upb_fielddef *f, upb_msgdef *msgdef) {
static upb_flow_t upb_dmsgsink_value(void *_m, upb_value fval, upb_value val) {
upb_msg *m = _m;
upb_fielddef *f = upb_value_getfielddef(fval);
+ if (upb_isstring(f)) {
+ //fprintf(stderr, "dmsg_value! this=%p f=%p name=" UPB_STRFMT ",
+ // " UPB_STRFMT " %p\n", m, f, UPB_STRARG(f->name), UPB_STRARG(val.val.str));
+ } else {
+ //fprintf(stderr, "dmsg_value! this=%p f=%p name=" UPB_STRFMT ",
+ // %llu\n", m, f, UPB_STRARG(f->name), val.val.uint64);
+ }
upb_msg_appendval(m, f, val);
return UPB_CONTINUE;
}
@@ -306,8 +313,11 @@ static upb_flow_t upb_dmsgsink_value(void *_m, upb_value fval, upb_value val) {
static upb_sflow_t upb_dmsgsink_startsubmsg(void *_m, upb_value fval) {
upb_msg *m = _m;
upb_fielddef *f = upb_value_getfielddef(fval);
+ //fprintf(stderr, "dmsg_startsubmsg! " UPB_STRFMT " %p\n", UPB_STRARG(fval.val.fielddef->name), f);
upb_msgdef *msgdef = upb_downcast_msgdef(f->def);
- return UPB_CONTINUE_WITH(upb_msg_appendmsg(m, f, msgdef));
+ void *p = upb_msg_appendmsg(m, f, msgdef);
+ //printf("Continuing with: %p\n", p);
+ return UPB_CONTINUE_WITH(p);
}
void upb_msg_regdhandlers(upb_handlers *h) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback