This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add protocol buffers for binary injection/joining
Replace the internal use of `encoding/binary` inside of `(*binaryPropagator).Join` and `(*binaryPropagator).Inject` with Google's Protocol buffers. Gogoproto is used for the go code generation since it provides considerable performance gains over the protobuf. ``` name old time/op new time/op delta Span_Empty-2 742ns ± 0% 743ns ± 0% +0.19% (p=0.000 n=9+10) Span_100Events-2 50.2µs ± 1% 50.2µs ± 1% ~ (p=0.853 n=10+10) Span_1000Events-2 50.1µs ± 0% 50.2µs ± 1% ~ (p=0.182 n=9+10) Span_100Tags-2 46.8µs ± 1% 47.0µs ± 0% +0.36% (p=0.043 n=9+10) Span_1000Tags-2 46.8µs ± 1% 47.0µs ± 1% +0.48% (p=0.004 n=10+9) Span_100BaggageItems-2 154µs ± 0% 155µs ± 1% +0.28% (p=0.013 n=9+10) TrimmedSpan_100Events_100Tags_100BaggageItems-2 178µs ± 0% 179µs ± 0% +0.30% (p=0.000 n=10+10) Inject_TextMap_Empty-2 2.49µs ± 2% 2.47µs ± 1% ~ (p=0.095 n=10+8) Inject_TextMap_100BaggageItems-2 101µs ± 1% 102µs ± 1% +0.90% (p=0.011 n=10+10) Inject_Binary_Empty-2 1.03µs ± 0% 0.49µs ± 0% -51.95% (p=0.000 n=10+7) Inject_Binary_100BaggageItems-2 61.0µs ± 1% 16.0µs ± 2% -73.85% (p=0.000 n=10+9) Join_TextMap_Empty-2 3.34µs ± 0% 3.48µs ± 0% +4.23% (p=0.000 n=10+10) Join_TextMap_100BaggageItems-2 155µs ± 0% 157µs ± 0% +1.17% (p=0.000 n=10+9) Join_Binary_Empty-2 1.75µs ± 1% 1.49µs ± 0% -15.14% (p=0.000 n=10+10) Join_Binary_100BaggageItems-2 95.4µs ± 0% 46.6µs ± 1% -51.18% (p=0.000 n=10+10) name old alloc/op new alloc/op delta Span_Empty-2 0.00B ±NaN% 0.00B ±NaN% ~ (all samples are equal) Span_100Events-2 16.1kB ± 0% 16.1kB ± 0% ~ (all samples are equal) Span_1000Events-2 16.1kB ± 0% 16.1kB ± 0% ~ (all samples are equal) Span_100Tags-2 10.5kB ± 0% 10.5kB ± 0% ~ (p=1.000 n=10+10) Span_1000Tags-2 10.5kB ± 0% 10.5kB ± 0% ~ (p=0.946 n=9+10) Span_100BaggageItems-2 10.5kB ± 0% 10.5kB ± 0% ~ (p=0.590 n=10+10) TrimmedSpan_100Events_100Tags_100BaggageItems-2 0.00B ±NaN% 0.00B ±NaN% ~ (all samples are equal) Inject_TextMap_Empty-2 393B ± 0% 393B ± 0% ~ (all samples are equal) Inject_TextMap_100BaggageItems-2 15.0kB ± 0% 15.0kB ± 0% ~ (all samples are equal) Inject_Binary_Empty-2 219B ± 0% 168B ± 0% -23.29% (p=0.000 n=10+10) Inject_Binary_100BaggageItems-2 23.8kB ± 1% 16.3kB ± 0% -31.34% (p=0.000 n=10+10) Join_TextMap_Empty-2 368B ± 0% 368B ± 0% ~ (all samples are equal) Join_TextMap_100BaggageItems-2 23.6kB ± 0% 23.6kB ± 0% ~ (p=0.970 n=10+10) Join_Binary_Empty-2 256B ± 0% 224B ± 0% -12.50% (p=0.000 n=10+10) Join_Binary_100BaggageItems-2 22.5kB ± 0% 21.7kB ± 0% -3.49% (p=0.000 n=10+9) name old allocs/op new allocs/op delta Span_Empty-2 0.00 ±NaN% 0.00 ±NaN% ~ (all samples are equal) Span_100Events-2 8.00 ± 0% 8.00 ± 0% ~ (all samples are equal) Span_1000Events-2 8.00 ± 0% 8.00 ± 0% ~ (all samples are equal) Span_100Tags-2 11.0 ± 0% 11.0 ± 0% ~ (all samples are equal) Span_1000Tags-2 11.0 ± 0% 11.0 ± 0% ~ (all samples are equal) Span_100BaggageItems-2 11.0 ± 0% 11.0 ± 0% ~ (all samples are equal) TrimmedSpan_100Events_100Tags_100BaggageItems-2 0.00 ±NaN% 0.00 ±NaN% ~ (all samples are equal) Inject_TextMap_Empty-2 6.00 ± 0% 6.00 ± 0% ~ (all samples are equal) Inject_TextMap_100BaggageItems-2 206 ± 0% 206 ± 0% ~ (all samples are equal) Inject_Binary_Empty-2 9.00 ± 0% 5.00 ± 0% -44.44% (p=0.000 n=10+10) Inject_Binary_100BaggageItems-2 409 ± 0% 5 ± 0% -98.78% (p=0.000 n=10+10) Join_TextMap_Empty-2 14.0 ± 0% 14.0 ± 0% ~ (all samples are equal) Join_TextMap_100BaggageItems-2 424 ± 0% 424 ± 0% ~ (all samples are equal) Join_Binary_Empty-2 10.0 ± 0% 6.0 ± 0% -40.00% (p=0.000 n=10+10) Join_Binary_100BaggageItems-2 618 ± 0% 217 ± 0% -64.89% (p=0.000 n=10+10) ``` Use sfixed64 in the proto file per feedback Add test for ProtobufCarrier Reflect carrier simplification changes Ignore autogenerated protobuf files in CI TravisCI currently fails since the autogenerated protobuf files don't pass golint. The patch performs an inverted match on the golint output, allowing for `*.pb.go` files to be ignored.
- Loading branch information