Skip to content

Commit 53d41d3

Browse files
authored
Fix benchmark Propagators and release 0.5.0 numbers (#870)
1 parent bc9658d commit 53d41d3

File tree

2 files changed

+60
-5
lines changed

2 files changed

+60
-5
lines changed

benchmark/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,58 @@ The minimum sample size is set to 10 to perform statistical analysis on benchmar
1313
1414
## Results
1515

16+
### `v0.5.0` release
17+
18+
```
19+
Beginning NoopTracerProvider Benchmark...
20+
5 tests completed.
21+
22+
#startSpan x 766,888,261 ops/sec ±1.81% (20 runs sampled)
23+
#startSpan:parent x 755,332,363 ops/sec ±1.51% (20 runs sampled)
24+
#startSpan with attribute x 765,932,668 ops/sec ±1.45% (20 runs sampled)
25+
#startSpan with 30 attributes x 1,333,216 ops/sec ±10.66% (20 runs sampled)
26+
#startSpan with 100 attributes x 477,974 ops/sec ±3.66% (20 runs sampled)
27+
28+
Beginning BasicTracerProvider Benchmark...
29+
5 tests completed.
30+
31+
#startSpan x 94,710 ops/sec ±19.20% (20 runs sampled)
32+
#startSpan:parent x 62,938 ops/sec ±3.77% (20 runs sampled)
33+
#startSpan with attribute x 93,389 ops/sec ±7.70% (20 runs sampled)
34+
#startSpan with 30 attributes x 33,753 ops/sec ±8.07% (20 runs sampled)
35+
#startSpan with 100 attributes x 2,497 ops/sec ±14.78% (20 runs sampled)
36+
37+
Beginning BasicTracerProvider with SimpleSpanProcessor Benchmark...
38+
5 tests completed.
39+
40+
#startSpan x 100,159 ops/sec ±7.17% (20 runs sampled)
41+
#startSpan:parent x 63,848 ops/sec ±5.78% (20 runs sampled)
42+
#startSpan with attribute x 96,301 ops/sec ±9.39% (20 runs sampled)
43+
#startSpan with 30 attributes x 36,410 ops/sec ±2.21% (20 runs sampled)
44+
#startSpan with 100 attributes x 3,549 ops/sec ±3.33% (20 runs sampled)
45+
46+
Beginning BasicTracerProvider with BatchSpanProcessor Benchmark...
47+
5 tests completed.
48+
49+
#startSpan x 90,992 ops/sec ±17.91% (20 runs sampled)
50+
#startSpan:parent x 64,590 ops/sec ±4.18% (20 runs sampled)
51+
#startSpan with attribute x 107,706 ops/sec ±2.21% (20 runs sampled)
52+
#startSpan with 30 attributes x 24,199 ops/sec ±45.57% (20 runs sampled)
53+
#startSpan with 100 attributes x 2,645 ops/sec ±9.86% (20 runs sampled)
54+
55+
Beginning B3Propagator Benchmark...
56+
2 tests completed.
57+
58+
#Inject x 2,018,725 ops/sec ±3.49% (100 runs sampled)
59+
#Extract x 2,040,891 ops/sec ±1.75% (100 runs sampled)
60+
61+
Beginning HttpTraceContext Benchmark...
62+
2 tests completed.
63+
64+
#Inject x 3,987,007 ops/sec ±1.87% (100 runs sampled)
65+
#Extract x 1,792,743 ops/sec ±0.93% (100 runs sampled)
66+
```
67+
1668
### `v0.3.3` release
1769

1870
```

benchmark/propagator.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
const benchmark = require('./benchmark');
44
const opentelemetry = require('../packages/opentelemetry-core');
5+
const api = require('../packages/opentelemetry-api');
6+
const { Context } = require('../packages/opentelemetry-context-base');
57

68
const setups = [
79
{
@@ -28,13 +30,14 @@ for (const setup of setups) {
2830
const propagator = setup.propagator;
2931
const suite = benchmark(100)
3032
.add('#Inject', function () {
31-
propagator.inject({
32-
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
33-
spanId: '6e0c63257de34c92'
34-
}, setup.name, setup.injectCarrier);
33+
propagator.inject(
34+
opentelemetry.setExtractedSpanContext(Context.ROOT_CONTEXT, {
35+
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
36+
spanId: '6e0c63257de34c92'
37+
}), setup.injectCarrier, api.defaultSetter);
3538
})
3639
.add('#Extract', function () {
37-
propagator.extract(setup.name, setup.extractCarrier);
40+
propagator.extract(Context.ROOT_CONTEXT, setup.extractCarrier, api.defaultGetter);
3841
});
3942

4043
// run async

0 commit comments

Comments
 (0)