Skip to content

perf(web): speed up folder menu sorting - #10190

Open
AksharP5 wants to merge 1 commit into
pingdotgg:mainfrom
AksharP5:perf/breadcrumb-filename-sort
Open

perf(web): speed up folder menu sorting#10190
AksharP5 wants to merge 1 commit into
pingdotgg:mainfrom
AksharP5:perf/breadcrumb-filename-sort

Conversation

@AksharP5

@AksharP5 AksharP5 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What Changed

Folder breadcrumb menus repeat locale setup for each filename comparison. Reuse one lazily created collator per menu calculation, keeping the existing natural ordering and folder precedence.

Fixes #10191.

Why

On this repository's 169-entry apps/web/src folder, the complete menu-list helper dropped from 1.39 ms to 0.20 ms. This is a warmed Node 26.8.1 benchmark on Linux, not measured UI latency. The output was identical.

Verification

  • All 10 filePath.test.ts tests pass, including natural ordering and stable ties across case and leading-zero variants.
  • Scoped TypeScript check, targeted lint, formatting, and git diff --check pass.
  • Independent code review found no issues.

Checklist

  • This PR is small and focused
  • I explained what changed and why

No visual or interaction changes.

Implemented and reviewed with GPT-6 through Codex.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 5, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9fce8b0

Macroscope's review found this PR approvable — This small optimization reuses a lazily created collator while preserving the existing folder precedence and natural filename ordering. The accompanying test covers equivalent-name ordering, and no broader runtime capability or configuration behavior is introduced.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Folder breadcrumb sorting repeats locale setup

1 participant