MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / compareBenchRuns

Function compareBenchRuns

scripts/bench-ci-compare.mjs:529–691  ·  view source on GitHub ↗
(baselineRunRaw, currentRunRaw, config, options = {})

Source from the content-addressed store, hash-verified

527}
528
529export function compareBenchRuns(baselineRunRaw, currentRunRaw, config, options = {}) {
530 const baselineRun = normalizeBenchRun(baselineRunRaw, "baseline");
531 const currentRun = normalizeBenchRun(currentRunRaw, "current");
532 const baselineIndex = indexBenchResults(baselineRun, "baseline");
533 const currentIndex = indexBenchResults(currentRun, "current");
534
535 const metricPaths = [...config.defaultRules.keys()].sort();
536 const checks = [];
537
538 for (const req of config.requiredScenarios) {
539 const baselineResult = baselineIndex.get(req.key) ?? null;
540 const currentResult = currentIndex.get(req.key) ?? null;
541
542 if (!baselineResult) {
543 for (const metric of metricPaths) {
544 checks.push(
545 buildMissingResultCheck(
546 req,
547 metric,
548 STATUS.MISSING_BASELINE_RESULT,
549 "required scenario missing from baseline results",
550 ),
551 );
552 }
553 continue;
554 }
555 if (!currentResult) {
556 for (const metric of metricPaths) {
557 checks.push(
558 buildMissingResultCheck(
559 req,
560 metric,
561 STATUS.MISSING_CURRENT_RESULT,
562 "required scenario missing from current results",
563 ),
564 );
565 }
566 continue;
567 }
568
569 for (const metric of metricPaths) {
570 const resolved = resolveRule(config, {
571 scenario: req.scenario,
572 framework: req.framework,
573 params: req.params,
574 metric,
575 });
576 if (!resolved) continue;
577
578 const baselineValue = getMetricValue(baselineResult.metrics, metric);
579 const currentValue = getMetricValue(currentResult.metrics, metric);
580
581 if (baselineValue === null) {
582 checks.push({
583 scenario: req.scenario,
584 framework: req.framework,
585 params: req.params,
586 metric,

Callers 2

runCliFunction · 0.85

Calls 11

normalizeBenchRunFunction · 0.85
indexBenchResultsFunction · 0.85
buildMissingResultCheckFunction · 0.85
resolveRuleFunction · 0.85
getMetricValueFunction · 0.85
computeDeltaStatsFunction · 0.85
sortChecksFunction · 0.85
keysMethod · 0.65
getMethod · 0.45
pushMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected