Skip to content

Commit

Permalink
Fix benchmark Propagators and release 0.5.0 numbers (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Mar 18, 2020
1 parent bc9658d commit 53d41d3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 5 deletions.
52 changes: 52 additions & 0 deletions benchmark/README.md
Expand Up @@ -13,6 +13,58 @@ The minimum sample size is set to 10 to perform statistical analysis on benchmar
## Results

### `v0.5.0` release

```
Beginning NoopTracerProvider Benchmark...
5 tests completed.
#startSpan x 766,888,261 ops/sec ±1.81% (20 runs sampled)
#startSpan:parent x 755,332,363 ops/sec ±1.51% (20 runs sampled)
#startSpan with attribute x 765,932,668 ops/sec ±1.45% (20 runs sampled)
#startSpan with 30 attributes x 1,333,216 ops/sec ±10.66% (20 runs sampled)
#startSpan with 100 attributes x 477,974 ops/sec ±3.66% (20 runs sampled)
Beginning BasicTracerProvider Benchmark...
5 tests completed.
#startSpan x 94,710 ops/sec ±19.20% (20 runs sampled)
#startSpan:parent x 62,938 ops/sec ±3.77% (20 runs sampled)
#startSpan with attribute x 93,389 ops/sec ±7.70% (20 runs sampled)
#startSpan with 30 attributes x 33,753 ops/sec ±8.07% (20 runs sampled)
#startSpan with 100 attributes x 2,497 ops/sec ±14.78% (20 runs sampled)
Beginning BasicTracerProvider with SimpleSpanProcessor Benchmark...
5 tests completed.
#startSpan x 100,159 ops/sec ±7.17% (20 runs sampled)
#startSpan:parent x 63,848 ops/sec ±5.78% (20 runs sampled)
#startSpan with attribute x 96,301 ops/sec ±9.39% (20 runs sampled)
#startSpan with 30 attributes x 36,410 ops/sec ±2.21% (20 runs sampled)
#startSpan with 100 attributes x 3,549 ops/sec ±3.33% (20 runs sampled)
Beginning BasicTracerProvider with BatchSpanProcessor Benchmark...
5 tests completed.
#startSpan x 90,992 ops/sec ±17.91% (20 runs sampled)
#startSpan:parent x 64,590 ops/sec ±4.18% (20 runs sampled)
#startSpan with attribute x 107,706 ops/sec ±2.21% (20 runs sampled)
#startSpan with 30 attributes x 24,199 ops/sec ±45.57% (20 runs sampled)
#startSpan with 100 attributes x 2,645 ops/sec ±9.86% (20 runs sampled)
Beginning B3Propagator Benchmark...
2 tests completed.
#Inject x 2,018,725 ops/sec ±3.49% (100 runs sampled)
#Extract x 2,040,891 ops/sec ±1.75% (100 runs sampled)
Beginning HttpTraceContext Benchmark...
2 tests completed.
#Inject x 3,987,007 ops/sec ±1.87% (100 runs sampled)
#Extract x 1,792,743 ops/sec ±0.93% (100 runs sampled)
```

### `v0.3.3` release

```
Expand Down
13 changes: 8 additions & 5 deletions benchmark/propagator.js
Expand Up @@ -2,6 +2,8 @@

const benchmark = require('./benchmark');
const opentelemetry = require('../packages/opentelemetry-core');
const api = require('../packages/opentelemetry-api');
const { Context } = require('../packages/opentelemetry-context-base');

const setups = [
{
Expand All @@ -28,13 +30,14 @@ for (const setup of setups) {
const propagator = setup.propagator;
const suite = benchmark(100)
.add('#Inject', function () {
propagator.inject({
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92'
}, setup.name, setup.injectCarrier);
propagator.inject(
opentelemetry.setExtractedSpanContext(Context.ROOT_CONTEXT, {
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92'
}), setup.injectCarrier, api.defaultSetter);
})
.add('#Extract', function () {
propagator.extract(setup.name, setup.extractCarrier);
propagator.extract(Context.ROOT_CONTEXT, setup.extractCarrier, api.defaultGetter);
});

// run async
Expand Down

0 comments on commit 53d41d3

Please sign in to comment.