Skip to content

perf(web): defer PR partition reads until armed - #11416

Closed
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:fix/prperf-1-partitions
Closed

Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:fix/prperf-1-partitions

Conversation

@Adamulek123

@Adamulek123 Adamulek123 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Opening the PR tab fires 3 full listings (all plus authored plus reviewing) on cold open, tripling GitHub search cost and per-repo spawns on other hosts. The partitions exist so Authored and Reviewing tabs open instantly, so they cannot just be deleted.

What changed

Authored and reviewing partition reads now wait for a latched partitionsArmed gate (idle callback with timeout, or pointer and focus entering the PR column). Cold open drops to 1 search to first paint and partitions converge shortly after. Steady-state cache keys are unchanged, so tab switches still hit cache. Partition target construction was extracted into buildPullRequestPartitionTargets in pullRequestList logic with no behavior change.

Validation

  • pullRequestList.logic.test.ts: 122 passed (4 new gate tests including multi-env fan-out)
  • web typecheck clean
  • Known hole, documented in code: route wiring (armed flag, idle effect, hover warmers) has no render test; builder gating is unit-tested. Follow-up is to export PullRequestsColumn and assert handler forwarding.

Measured impact

Compared with main-latest.json from main commit b1e223e, using the focused partition-gating suite:

Cold open Main This PR Change
Searches to first paint 3 1 -2 (-67%)
Focused tests 5 pass 9 pass +4 gate tests

Partitions converge post-arm and later tab switches still answer from the warmed cache. Coverage: GUARD-ONLY (route wiring hole documented above).

Built with Muse Spark (opencode/muse-spark-1.3) via implement and audit subagent loops with strict branch-audit reviews.

Summary by CodeRabbit

  • Performance

    • Deferred loading of pull request priority groups until the list is interacted with or the browser is idle.
    • Limited priority-group requests to relevant filters and available baseline results.
  • Bug Fixes

    • Improved pull request list interactions by consistently triggering priority-group loading on pointer or keyboard focus.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 12, 2026
@Adamulek123

Copy link
Copy Markdown
Contributor Author

Perf proof (pr-load-perf harness, baseline b1e223e)

  • Branch c432e47: harness PASS; scenario prperf-1 9/9 (baseline 5).
  • Asserted: authored-precedence, Others feed-order, continuation dedup through buildPullRequestPartitionTargets; 3 searches to first paint become 1 until armed.
  • Coverage: GUARD-ONLY (route wiring hole documented in description). Own-file wall time plus 104 percent is focused-test time, not user-facing.

@greatitself

Copy link
Copy Markdown

Independent validation of c432e478be4db942a8106a66d51ac14120cd97d9 (merge-base 1d1bf50405cc).

Exercised all 8 wanted/armed/baseline flag combinations with 0–5 environments (48 fixtures). Disabled combinations produced no targets. Enabled combinations retained each environment’s own project IDs, including empty project arrays, with the selected host/state/filter and involvement intact. Inputs were frozen to catch accidental mutation. This validates target generation and isolation; it does not measure browser idle scheduling or actual query counts.

Reproduction scripts and recorded results — second.mjs; the numbered metadata file pins this PR’s tested revisions.

Model: GPT-6. Harness: Codex.

@Adamulek123
Adamulek123 force-pushed the fix/prperf-1-partitions branch from c432e47 to 25b0794 Compare September 12, 2026 19:45
@Adamulek123
Adamulek123 marked this pull request as ready for review September 13, 2026 15:04
@macroscopeapp

macroscopeapp Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This production change alters pull-request loading behavior by deferring two environment-wide server reads until idle time or column engagement. It changes both cold-open network usage and the timing of Authored/Reviewing data, so the scheduling gate and its user-visible loading impact merit human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6371ed37-e768-479d-a5b0-c798f126d175

📥 Commits

Reviewing files that changed from the base of the PR and between c542b78 and 764668d.

📒 Files selected for processing (4)
  • apps/web/src/components/pullRequest/pullRequestList.logic.test.ts
  • apps/web/src/components/pullRequest/pullRequestList.logic.ts
  • apps/web/src/routes/_chat.pull-requests.test.tsx
  • apps/web/src/routes/_chat.pull-requests.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Pull-request partition loading

Layer / File(s) Summary
Partition target contract and builder
apps/web/src/components/pullRequest/pullRequestList.logic.ts, apps/web/src/components/pullRequest/pullRequestList.logic.test.ts
Adds partition target types and builds authored and reviewing targets only when requested, armed, and supported by baseline rows. Tests cover gating, per-environment fan-out, and query fields.
Deferred partition query wiring
apps/web/src/routes/_chat.pull-requests.tsx
Uses the builder for deferred partition queries and passes the partition-warming callback through the exported PullRequestsColumn interface.
Column interaction triggers
apps/web/src/routes/_chat.pull-requests.tsx, apps/web/src/routes/_chat.pull-requests.test.tsx
Triggers partition warming on pointer entry or focus capture. Tests verify both handlers invoke the callback once.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant PullRequestsColumn
  participant PullRequestsRoute
  participant buildPullRequestPartitionTargets
  participant PartitionQueries
  PullRequestsColumn->>PullRequestsRoute: onPartitionsIntent()
  PullRequestsRoute->>buildPullRequestPartitionTargets: build armed targets
  buildPullRequestPartitionTargets->>PartitionQueries: authored and reviewing targets
  PartitionQueries-->>PullRequestsRoute: partition results
Loading

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to 76466

The deferred partition loads retain their query inputs and warm correctly after interaction or scheduled arming, with no actionable merge risk identified.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the change, motivation, validation, and measured impact, but it does not follow the required template. The Why and Checklist sections are missing, and the interaction … Update the description to include the required What Changed, Why, UI Changes, and Checklist sections. Add a short video for the pointer/focus interaction change, or explain why the UI Changes section does not apply.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main performance change: deferring pull-request partition reads until the partitions are armed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the change, motivation, validation, and measured impact, but it does not follow the required template. The Why and Checklist sections are missing, and the interaction change has no required video or explicit UI Changes section.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@Adamulek123
Adamulek123 marked this pull request as draft September 20, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants