Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply updates suggested in PR comment #1

Merged

Conversation

dyladan
Copy link

@dyladan dyladan commented Jan 17, 2020

Making this into your branch so you can see what you think.

@@ -3,5 +3,5 @@
const execSync = require('child_process').execSync;
const exec = cmd => execSync(cmd, { stdio: [0, 1, 2] });

exec('node benchmark/tracer');
exec('node benchmark/propagator');
exec('node benchmark/tracer.js');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue oliver was talking about

@@ -1,7 +1,7 @@
'use strict';

const benchmark = require('./benchmark');
const opentelemetry = require('@opentelemetry/core');
const opentelemetry = require('../packages/opentelemetry-core');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading by filepath removes dependency management issues and ensures you're testing the current checked out branch

@@ -26,7 +26,7 @@ const setups = [
for (const setup of setups) {
console.log(`Beginning ${setup.name} Benchmark...`);
const propagator = setup.propagator;
const suite = benchmark()
const suite = benchmark(100)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatters are fast so we can run them more times


const exporter = new InMemorySpanExporter();
const logger = new opentelemetry.NoopLogger();

const setups = [
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these setups make more sense since Basic and Node TracerRegistries return the same Tracer class so their performance should be identical.

registry: getRegistry(new BatchSpanProcessor(new InMemorySpanExporter()))
},
{
name: 'NoopTracerRegistry',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a noop as a baseline

const tracer = registry.getTracer("benchmark");
const suite = benchmark()
const tracer = setup.registry.getTracer("benchmark");
const suite = benchmark(20)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tracer tests run slower so I did fewer runs. feel free to tweak it

Copy link
Owner

@mayurkale22 mayurkale22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, overall lgtm. I am fine with the current sample numbers, we can tweak it as per the need in the future. Also, I liked the idea of running benchmark of the currently checked out branch. 👍

@mayurkale22 mayurkale22 merged commit 5d95c4d into mayurkale22:benchmarrk_readme Jan 21, 2020
@dyladan dyladan deleted the benchmark-fix branch January 21, 2020 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants