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

ci(NODE-6755): add tags to benchmarks #4419

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

ci(NODE-6755): add tags to benchmarks #4419

wants to merge 12 commits into from

Conversation

W-A-James
Copy link
Contributor

@W-A-James W-A-James commented Feb 13, 2025

Description

What is changing?

  • Add tags to BenchmarkModule type to facilitate adding tags to benchmarks that get reported when using perf.send
  • Added TAG enum to driver.mts that contains the tags we use across all of our benchmarks for ease of use and to prevent accidental misspellings of tags
  • Added appropriate tags to all benchmark files
  • Added normalized_throughput measurement to all benchmarks
    • For ping, this is calculated as NORMALIZED_PING_SCALING_CONST * ping_throughput_in_megabytes_per_second/primes_throughput_in_megabytes_per_second
    • For all other benchmarks this is calculated as throughput_in_megabytes_per_second/ping_throughput_in_megabytes_per_second
  • Updated driver_bench readme
Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@W-A-James W-A-James marked this pull request as ready for review February 18, 2025 22:48
@W-A-James W-A-James requested a review from a team as a code owner February 18, 2025 22:48
@nbbeeken nbbeeken self-assigned this Feb 19, 2025
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 19, 2025
@W-A-James W-A-James requested a review from nbbeeken February 19, 2025 20:02
@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Feb 19, 2025
@dariakp dariakp self-requested a review February 20, 2025 21:30

// Constant used to scale normalized_throughput results for ping benchmark to be roughly in the
// range 0 - 9 to make it easier to work with
export const NORMALIZED_PING_SCALING_CONST = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is kind of splitting hairs, but I was hoping this scaling would happen internally to the primes benchmark because ideally we'd never touch this parameter or the primes benchmark itself once we set this up. I thought it might be most helpful for the output of our primes benchmark itself to be a unit (order of 1^0) so that it represents what we think of as the baseline cpu performance (particularly since in bson it will be used for all the scalings). I wanted to take the mean of the current stable region for the baseline cpu performance and scale it to === 1, then when we look at the baseline cpu performance, we can see that it's 2x or 3x or 0.5x relative to when we started tracking it, and that number would be easy to interpret. And when we factor that number from any benchmark (for the driver, just ping), that cpu-normalized benchmark would have a more direct connection to the absolute result.

assert.ok(primesBench, 'primes bench results not found!');
const pingThroughput = pingBench.metrics[0].value;
const primesThroughput = primesBench.metrics[0].value;
primesBench.metrics.push({ 'name': 'normalized_throughput', value: NORMALIZED_PING_SCALING_CONST * pingThroughput / primesThroughput });
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be just primesThroughput, no fancy math, taking my other comment into account

const finalResults = calculateCompositeBenchmarks(results);
function calculateNormalizedResults(results: MetricInfo[]): MetricInfo[] {
const primesBench = results.find(r => r.info.test_name === 'primes');
const pingBench = results.find(r => r.info.test_name === 'ping');
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be able to go away, then adjust the loop below to continue iff 'primes', and push metrics.value / primesThroughput for ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants