Skip to content

chore: add Phase 4.1 performance evidence - #687

Merged
tariknz merged 4 commits into
mainfrom
chore/phase-4-1-performance-evidence
Aug 9, 2026
Merged

chore: add Phase 4.1 performance evidence#687
tariknz merged 4 commits into
mainfrom
chore/phase-4-1-performance-evidence

Conversation

@tariknz

@tariknz tariknz commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Description

Completes the Phase 4.1 packaged Windows performance evidence gate described in docs/IMPLEMENTATION_PLAN.md.

The final Phase 3 build (6fbc334) and current main (28cbf61e) were compared with packaged builds, the same deterministic 40-car replay tape, dashboard/settings, three-display 7680x1440 geometry, and default Chromium flags. Each full-dashboard capture ran for 420 seconds with a 60-second analysis warm-up.

CPU and responsiveness remain stable:

  • app CPU: 3.94% to 3.71%
  • renderer CPU: 2.27% to 1.97%
  • processTelemetry p99: 1.87 ms to 1.94 ms
  • minimum telemetry cadence: 21.34 Hz
  • event-loop p99: 31.22 ms
  • renderer frames over 50 ms: 0%

The memory gate remains open. Main-process private-memory growth reproduced at +5.60 MB/min versus the previous Phase 4 result of +5.82 MB/min.

Because retention remained significant, this adds benchmark-only main-process V8 heap sampling controlled by PERF_HEAP_PROFILE_PATH. The matched retention capture sampled 2.50 MiB of live allocations. Logging serialization accounted for 52.5%, SDK parsing 18.2%, timers 16.0%, and processor registry/processors only 6.3%. The evidence does not support processor snapshots, reusable buffers, channel publication, or subscription ownership as the primary retention owner. Follow-up should isolate logging/transport buffers and external/native or reserved V8 memory before proposing processor fixes.

The strict comparison analyzer reports the A/B as inconclusive because the historical Phase 3 artifact predates the current capture-origin/scenario/widget-input metadata and the replay does not exercise event-driven lap-time/radio publications. The matched raw metrics and this limitation are documented explicitly.

Phase 4 is now recorded as delivered and validated with its memory gate open. This PR does not begin Phase 5 or Phase 6.

Screenshots

Before

Not applicable — no visual changes.

After

Not applicable — performance evidence, documentation, and benchmark-only instrumentation.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Performance improvement
  • Refactoring (no functional changes)
  • Documentation update
  • Dependency update

Checklist

  • I have discussed this change in the discord server
  • I have tested this in iRacing (either in an online session or with AI)
  • All tests pass locally via npm test
  • I have added tests that prove my fix is effective or that my feature works
  • I have run npm run lint and fixed any issues
  • I have performed a self-review of my own code
  • I have added/updated Storybook stories for visual changes
  • I have updated the README.md (if applicable)
  • I have updated defaultDashboard.ts if introducing new widgets or configurations (if applicable)

Validation

  • Packaged Windows full-dashboard replay: 420 seconds, 60-second warm-up
  • Matched main-process V8 retained-allocation capture: 420 seconds
  • TypeScript tsc --noEmit: passed
  • Prettier checks: passed
  • git diff --check: passed
  • Commit hooks: Prettier and ESLint passed for staged files
  • Full npm run lint: blocked by the existing nested tmp-data/irsdk-replay-worktree, which creates unrelated TypeScript ESLint parser-root errors

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tariknz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 05802571-a953-4c16-a892-b0523c87d638

📥 Commits

Reviewing files that changed from the base of the PR and between 28cbf61 and 3725fa6.

📒 Files selected for processing (4)
  • docs/IMPLEMENTATION_PLAN.md
  • docs/PERFORMANCE_TEST_LOG.md
  • src/app/perfHeapProfiler.ts
  • src/main.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tariknz
tariknz marked this pull request as ready for review August 9, 2026 07:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: daff52f4bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main.ts Outdated
Comment on lines +150 to +151
if (heapProfiler) {
await heapProfiler.stop();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Quit even when profile export fails

When PERF_HEAP_PROFILE_PATH points to a missing or unwritable directory, heapProfiler.stop() rejects during the asynchronous timer callback, so the completion log and app.quit() are never reached. The fixed-duration performance run then remains alive indefinitely and also produces an unhandled rejection; catch and log the export error while placing app.quit() in a finally path.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a32f50a2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main.ts Outdated
? new PerfHeapProfiler(heapProfilePath)
: undefined;
if (heapProfiler) {
await heapProfiler.start();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Schedule benchmark exit even if heap sampling cannot start

When the inspector rejects connect, enable, or startSampling—for example because another sampling profiler is active—this awaited call rejects before the fixed-duration timer is registered. The performance run then never reaches its configured completion, and observer mode remains alive indefinitely; catch startup failures and ensure the duration timer is scheduled regardless.

Useful? React with 👍 / 👎.

Comment thread src/main.ts
await heapProfiler.start();
log.info(`[PerfRun] Main-process heap sampling started`);
}
if (perfRun.durationSeconds > 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Support or reject heap profiles for open-ended runs

When PERF_HEAP_PROFILE_PATH is used with the standard npm run perf:run default of no --duration-seconds, durationSeconds is zero and this branch is skipped. Sampling starts, but stop() and the profile write exist only inside this branch; stopping the runner with Ctrl+C terminates the app without producing the requested heap profile. Either require a fixed duration when profiling or add a shutdown path that exports the profile.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05922a9e27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main.ts Outdated
log.info(`[PerfRun] Main-process heap profile written`);
}
} catch (error) {
log.error(`[PerfRun] Main-process heap profile export failed`, error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Redact the heap-profile path before analytics

When analytics is enabled and profile export fails—for example, because PERF_HEAP_PROFILE_PATH names a missing directory—the Node filesystem error contains the verbatim path, and Analytics.setupLogTransport() forwards error-level log arguments to PostHog. Logging the raw error here therefore discloses a potentially user-identifying home-directory path; sanitize the path prefixes or log only non-path error fields.

AGENTS.md reference: AGENTS.md:L14-L18

Useful? React with 👍 / 👎.

@tariknz
tariknz merged commit 4bf0eb0 into main Aug 9, 2026
11 of 13 checks passed
@tariknz
tariknz deleted the chore/phase-4-1-performance-evidence branch August 9, 2026 08:17
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.

1 participant