@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public SpanContext toFromBinarySpanContext(Data data) throws SpanContextParseException {
    return data.binaryFormat.fromByteArray(data.binaryFormat.toByteArray(data.spanContext));
  }
@ Benchmark @ BenchmarkMode ( Mode . SampleTime ) @ OutputTimeUnit ( TimeUnit . NANOSECONDS ) public SpanContext toFromBinarySpanContext ( Data data ) throws SpanContextParseException { return data . binaryFormat . fromByteArray ( data . binaryFormat . toByteArray ( data . spanContext ) ) ; }
This benchmark attempts to measure performance of {@link
BinaryFormat#toBinaryValue(SpanContext)} then {@link BinaryFormat#fromBinaryValue(byte[])}.