[BENCHMARK] add SpanData recordable benchmark and unify common utils#4203
Conversation
…on. Update otlp recordable benchmark to match the SpanData benchmark
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4203 +/- ##
==========================================
- Coverage 82.79% 82.78% -0.00%
==========================================
Files 415 415
Lines 17452 17450 -2
==========================================
- Hits 14447 14445 -2
Misses 3005 3005
🚀 New features to boost your workflow:
|
| // BM_PopulateRequest/span_count:512_median 26.3 us 26.3 us 5 items_per_second=19.4746M/s | ||
| // BM_PopulateRequest/span_count:512_stddev 0.078 us 0.077 us 5 items_per_second=56.7323k/s | ||
| // BM_PopulateRequest/span_count:512_cv 0.30 % 0.29 % 5 items_per_second=0.29% | ||
| // Load Average: 2.05, 1.65, 1.67 |
There was a problem hiding this comment.
Comparing SpanData to OtlpRecordable performance on the recording benchmark cases from this PR (otlp_recordable_benchmark/span_data_benchmark) shows that recording span attributes, events, and links into the SpanData recordable (backed by STL types) outperforms recording into OtlpRecordable (backed by the protobuf span type).
This is interesting because SpanData enforces attribute key uniqueness (OltpRecordable does not) and it can meet requirements for additional span Readable/ReadWriteSpan interfaces.
| Benchmark | OtlpRecordable mean (ns) | SpanData mean (ns) | % Difference | CV Otlp | CV SpanData |
|---|---|---|---|---|---|
| RecordMinimalSpan | 362 | 341 | −5.8% | 0.49% | 0.28% |
| RecordNominalSpan | 638 | 581 | −8.9% | 1.26% | 2.63% |
| RecordSpanWithAttributes/1 | 414 | 390 | −5.8% | 0.47% | 1.07% |
| RecordSpanWithAttributes/10 | 880 | 705 | −19.9% | 1.46% | 0.90% |
| RecordSpanWithAttributes/128 | 7293 | 7479 | +2.6% | 11.55% | 2.53% |
| RecordSpanWithEvents/1 | 502 | 456 | −9.2% | 0.21% | 0.63% |
| RecordSpanWithEvents/10 | 1705 | 1584 | −7.1% | 1.70% | 1.54% |
| RecordSpanWithEvents/128 | 16750 | 16434 | −1.9% | 1.71% | 1.28% |
| RecordSpanWithLinks/1 | 511 | 435 | −14.9% | 1.13% | 0.49% |
| RecordSpanWithLinks/10 | 1784 | 1368 | −23.3% | 0.34% | 1.63% |
| RecordSpanWithLinks/128 | 19515 | 15304 | −21.6% | 12.31% | 6.08% |
marcalff
left a comment
There was a problem hiding this comment.
LGTM, thanks for the benchmark utilities.
This will help a lot.
|
The only changes in production code is 2 lines in span_data.cc, which should improve performances. |
Contributes to #4046
Changes
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes