Skip to content

Keep large Pierre diffs responsive - #136

Merged
pandemicsyn merged 1 commit into
mainfrom
agent/pierre-codeview-performance
Jul 17, 2026
Merged

pandemicsyn merged 1 commit into
mainfrom
agent/pierre-codeview-performance

Conversation

@pandemicsyn

Copy link
Copy Markdown
Owner

Summary

  • route patches with at least 2,000 changed rows through Pierre CodeView while preserving PatchDiff for ordinary patches
  • preserve review annotations, controlled selection, wrapping, themes, and the existing worker pool on the virtualized path
  • retain baseline, lower-level Virtualizer, direct CodeView, and production-auto benchmark variants
  • mark the original static-review finding completed without removing its history

Why

The retained 5,000- and 10,000-row baselines mounted 20,099 and 40,099 DOM nodes and accumulated 210 ms and 405 ms of long tasks. Direct CodeView was slower for an ordinary patch, so this uses a measured threshold instead of applying virtualization universally.

Measurement

  • 5,000 rows: ready 293.4 ms -> 107.7 ms; DOM 20,099 -> 668; heap 23.0 MiB -> 11.2 MiB; long tasks 210 ms -> 0
  • 10,000 rows through the production auto path: ready 500.6 ms -> 115.8 ms; DOM 40,099 -> 719; heap 22.8 MiB -> 12.9 MiB; long tasks 405 ms -> 0; scroll p95 12.8 ms
  • 5,000 rows plus 50 annotations: all 50 annotations mounted, selection mapping passed, and scroll p95 was 12.4 ms
  • the lower-level Virtualizer comparison missed the 16.7 ms scroll target at 17.7 ms p95
  • the already-lazy MultiFileView chunk increases from the retained 197.1 kB gzip baseline to 218.5 kB gzip; the initial entry is 156.9 kB gzip

Verification

  • npm run check (84 files, 524 tests)
  • npm run format:check
  • production and performance builds through the benchmark runner
  • three isolated Chromium samples per scenario
  • direct Chrome trace and selection/annotation probes
  • git diff --check

@pandemicsyn
pandemicsyn merged commit 66f7c4e into main Jul 17, 2026
5 checks passed
@pandemicsyn
pandemicsyn deleted the agent/pierre-codeview-performance branch July 17, 2026 03:27

@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: f69a2c2754

ℹ️ 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 on lines +83 to +86
id: codeViewItemId,
type: 'diff',
fileDiff: getSingularPatch(patch),
annotations: lineAnnotations,

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 Bump CodeView item identity when patches change

When a user switches between two already-loaded large files that both stay on the CodeView path, this publishes the new fileDiff and annotations under the same item id with no version. Pierre CodeView reconciles controlled items by id and only replaces the stored snapshot when the item version changes, so the second file can continue showing the previous large diff/comments while the surrounding file selector and review state have moved on. Use a path/content-derived id or bump version whenever patch or annotations change.

Useful? React with 👍 / 👎.

Comment on lines +34 to +37
textScale = 1.12,
) {
const { stickyHeader, ...options } = baseDiffOptions;
const lineHeight = 10.5 * 1.55 * textScale;

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 Pass the active text scale into CodeView metrics

In dashboards configured with compact, large, or a custom appearance.textScale, the CodeView path still estimates row height with the hard-coded 1.12 default while unsafeCSS renders rows from the inherited --deck-text-scale. Because CodeView uses itemMetrics to compute virtualized heights, scroll targets, and selection/anchor positions, non-default densities can mis-size large diffs even though the old PatchDiff path scaled directly with CSS. Thread the resolved appearance scale into this option or derive the metric from the same source as the CSS variable.

Useful? React with 👍 / 👎.

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