Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codefromthecrypt/8b73f488bfeb1d8dc86a8a2b5ee5c4ad to your computer and use it in GitHub Desktop.
Save codefromthecrypt/8b73f488bfeb1d8dc86a8a2b5ee5c4ad to your computer and use it in GitHub Desktop.
Finally got zipkin span encoding into the single-digit microsecond range
CodecBenchmarks.writeClientSpan_json_zipkin avgt 15 1.445 ± 0.036 us/op
CodecBenchmarks.writeClientSpan_thrift_libthrift avgt 15 1.951 ± 0.014 us/op
CodecBenchmarks.writeClientSpan_thrift_zipkin avgt 15 0.433 ± 0.011 us/op
CodecBenchmarks.writeLocalSpan_json_zipkin avgt 15 0.813 ± 0.010 us/op
CodecBenchmarks.writeLocalSpan_thrift_libthrift avgt 15 1.191 ± 0.016 us/op
CodecBenchmarks.writeLocalSpan_thrift_zipkin avgt 15 0.268 ± 0.004 us/op
CodecBenchmarks.writeRpcSpan_json_zipkin avgt 15 3.606 ± 0.068 us/op
CodecBenchmarks.writeRpcSpan_thrift_libthrift avgt 15 5.134 ± 0.081 us/op
CodecBenchmarks.writeRpcSpan_thrift_zipkin avgt 15 1.384 ± 0.078 us/op
CodecBenchmarks.writeRpcV6Span_json_zipkin avgt 15 3.912 ± 0.115 us/op
CodecBenchmarks.writeRpcV6Span_thrift_libthrift avgt 15 5.488 ± 0.098 us/op
CodecBenchmarks.writeRpcV6Span_thrift_zipkin avgt 15 1.323 ± 0.014 us/op
@codefromthecrypt
Copy link
Author

codefromthecrypt commented Aug 30, 2016

only way this worked was making it possible to calculate the encoded size of a span up-front. This meant no array resizing.
Trickiest parts of that were UTF-8 and IPv6 literal encoding. Here's a related issue I made for libthrift https://issues.apache.org/jira/browse/THRIFT-3913

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment