diff options
Diffstat (limited to 'benchmark/benchmark.cc')
-rw-r--r-- | benchmark/benchmark.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/benchmark/benchmark.cc b/benchmark/benchmark.cc index 10713a8..95709bc 100644 --- a/benchmark/benchmark.cc +++ b/benchmark/benchmark.cc @@ -73,19 +73,19 @@ int main () upb_msgdata_free(data, m, true); upb_context_free(&c); - benchmarks::SpeedMessage2 msg; - std::string stlstr(str.ptr, str.byte_len); - upb_strfree(str); - total = 0; - before = clock(); - for(int i = 0; i < 2000; i++) { - if(!msg.ParseFromString(stlstr)) { - fprintf(stderr, "Error parsing with proto2.\n"); - return 1; - } - total += str.byte_len; - } - elapsed = ((double)clock() - before) / CLOCKS_PER_SEC; - fprintf(stderr, "proto2 parsed %sB, ", eng(total, 3, false)); - fprintf(stderr, "%sB/s\n", eng(total/elapsed, 3, false)); + //benchmarks::SpeedMessage2 msg; + //std::string stlstr(str.ptr, str.byte_len); + //upb_strfree(str); + //total = 0; + //before = clock(); + //for(int i = 0; i < 2000; i++) { + // if(!msg.ParseFromString(stlstr)) { + // fprintf(stderr, "Error parsing with proto2.\n"); + // return 1; + // } + // total += str.byte_len; + //} + //elapsed = ((double)clock() - before) / CLOCKS_PER_SEC; + //fprintf(stderr, "proto2 parsed %sB, ", eng(total, 3, false)); + //fprintf(stderr, "%sB/s\n", eng(total/elapsed, 3, false)); } |