Todd Lipcon has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/9184 )

Change subject: jsonwriter: small optimization for PB fields
......................................................................

jsonwriter: small optimization for PB fields

This avoids extra non-inlinable calls into the protobuf library:
- extra calls to GetReflection()
- calls to FieldSize() while looping through repeated fields

This has a small benefit on all PBs and a big benefit on those PBs with
a lot of repeated fields. The latter should be a nice boost particularly
when serializing metrics.

Before:
TestJsonWriter.BenchmarkAllTypes      Throughput: 157.609MB/sec
TestJsonWriter.BenchmarkNestedMessage Throughput: 124.048MB/sec
TestJsonWriter.BenchmarkRepeatedInt64 Throughput: 113.77MB/sec

After:
TestJsonWriter.BenchmarkAllTypes      Throughput: 163.327MB/sec  (+3.6%)
TestJsonWriter.BenchmarkNestedMessage Throughput: 127.633MB/sec  (+2.9%)
TestJsonWriter.BenchmarkRepeatedInt64 Throughput: 158.229MB/sec  (+39.1%)

Change-Id: Iceee0096a3af9300fca3dd18508a12e140e99b31
Reviewed-on: http://gerrit.cloudera.org:8080/9184
Reviewed-by: Sailesh Mukil <sail...@cloudera.com>
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <t...@apache.org>
---
M src/kudu/util/jsonwriter-test.cc
M src/kudu/util/jsonwriter.cc
M src/kudu/util/jsonwriter.h
3 files changed, 36 insertions(+), 11 deletions(-)

Approvals:
  Sailesh Mukil: Looks good to me, but someone else must approve
  Kudu Jenkins: Verified
  Todd Lipcon: Looks good to me, approved

--
To view, visit http://gerrit.cloudera.org:8080/9184
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iceee0096a3af9300fca3dd18508a12e140e99b31
Gerrit-Change-Number: 9184
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Sailesh Mukil <sail...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Will Berkeley <wdberke...@gmail.com>

Reply via email to