summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-06-17 10:34:29 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-06-17 10:34:29 -0700
commit559e23c796f973a65d05c76e211835b126ee8ac8 (patch)
treeec359628f3b93b88718cc34e5ec86ca6e6c6c1e2 /benchmarks
parenta503b8859c37906ab5012db163daca43bfe393bb (diff)
Major refactoring: abandon upb_msg, add upb_accessors.
Next on the chopping block is upb_string.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/parsestream.upb_table.c4
-rw-r--r--benchmarks/parsetostruct.upb_table.c13
2 files changed, 7 insertions, 10 deletions
diff --git a/benchmarks/parsestream.upb_table.c b/benchmarks/parsestream.upb_table.c
index a4aebd8..b1763da 100644
--- a/benchmarks/parsestream.upb_table.c
+++ b/benchmarks/parsestream.upb_table.c
@@ -36,7 +36,7 @@ static bool initialize()
upb_printerr(&status);
return false;
}
- upb_parsedesc(s, fds_str, &status);
+ upb_read_descriptor(s, fds_str, &status);
upb_string_unref(fds_str);
if(!upb_ok(&status)) {
@@ -64,7 +64,7 @@ static bool initialize()
// 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);
- upb_decoder_init(&decoder, handlers);
+ upb_decoder_initforhandlers(&decoder, handlers);
upb_handlers_unref(handlers);
upb_stringsrc_init(&stringsrc);
return true;
diff --git a/benchmarks/parsetostruct.upb_table.c b/benchmarks/parsetostruct.upb_table.c
index f05395f..f0ddb99 100644
--- a/benchmarks/parsetostruct.upb_table.c
+++ b/benchmarks/parsetostruct.upb_table.c
@@ -9,7 +9,7 @@
static upb_string *input_str;
static upb_msgdef *def;
-static upb_msg *msg;
+static void *msg;
static upb_stringsrc strsrc;
static upb_decoder d;
@@ -25,7 +25,7 @@ static bool initialize()
upb_printerr(&status);
return false;
}
- upb_parsedesc(s, fds_str, &status);
+ upb_read_descriptor(s, fds_str, &status);
upb_string_unref(fds_str);
if(!upb_ok(&status)) {
@@ -49,13 +49,10 @@ static bool initialize()
return false;
}
upb_status_uninit(&status);
- msg = upb_msg_new(def);
+ msg = upb_stdmsg_new(def);
upb_stringsrc_init(&strsrc);
- upb_handlers *handlers = upb_handlers_new();
- upb_msg_reghandlers(handlers, def);
- upb_decoder_init(&d, handlers);
- upb_handlers_unref(handlers);
+ upb_decoder_initformsgdef(&d, def);
if (!BYREF) {
// Pretend the input string is stack-allocated, which will force its data
@@ -74,7 +71,7 @@ static void cleanup()
input_str->refcount.v = 1;
}
upb_string_unref(input_str);
- upb_msg_unref(msg, def);
+ upb_stdmsg_free(msg, def);
upb_def_unref(UPB_UPCAST(def));
upb_stringsrc_uninit(&strsrc);
upb_decoder_uninit(&d);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback