MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / executePhase

Method executePhase

app/src/Benchmark/BenchmarkRunner.cpp:525–563  ·  view source on GitHub ↗

* @brief Runs one phase (this blocks the UI), records its result, and advances or finishes. */

Source from the content-addressed store, hash-verified

523 * @brief Runs one phase (this blocks the UI), records its result, and advances or finishes.
524 */
525void BenchmarkRunner::executePhase(int index)
526{
527 const int phaseCount = static_cast<int>(m_phases.size());
528 Q_ASSERT(index >= 0 && index < phaseCount);
529
530 const PhaseSpec& spec = m_phases[index];
531 const HotpathBenchmark::Result r =
532 spec.dataPipeline ? HotpathBenchmark::runDataPipeline(m_frames, spec.minFps, m_seconds)
533 : HotpathBenchmark::run(m_frames,
534 spec.minFps,
535 m_seconds,
536 spec.language,
537 spec.exporters,
538 spec.strings,
539 spec.dashboard);
540
541 QVariantMap row;
542 row.insert(QStringLiteral("label"), spec.label);
543 row.insert(QStringLiteral("fps"), r.framesPerSecond);
544 row.insert(QStringLiteral("parsed"), static_cast<double>(r.framesParsed));
545 row.insert(QStringLiteral("skipped"), static_cast<double>(r.framesSkipped));
546 row.insert(QStringLiteral("seconds"), r.elapsedSeconds);
547 row.insert(QStringLiteral("target"), r.minFps);
548 row.insert(QStringLiteral("gated"), spec.minFps > 1.0);
549 row.insert(QStringLiteral("passed"), r.passed);
550 m_results.append(row);
551 Q_EMIT resultsChanged();
552
553 m_progress = static_cast<double>(index + 1) / phaseCount;
554 Q_EMIT progressChanged();
555
556 if (index + 1 < phaseCount) {
557 m_phaseIndex = index + 1;
558 announcePhase(index + 1);
559 return;
560 }
561
562 finishSession();
563}
564
565/**
566 * @brief Restores the session, clears the dashboard preview, and ends the run.

Callers

nothing calls this directly

Calls 3

runFunction · 0.85
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected