Skip to content

perf(web): speed up script export path conflict detection - #12225

Merged
morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:perf/web-script-layout-collisions
Nov 19, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:perf/web-script-layout-collisions

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Detect duplicate and file/directory-prefix conflicts in captured script layouts without constructing and storing every directory prefix. Sort full portable paths using a low-sorting segment separator, then mark each contiguous conflict group. The comparison is case-sensitive as before. The output still follows capture order, and scripts with unavailable content can still prevent canonical path selection.

Evidence

The planner and filesystem publication suites passed all 86 tests, including durable bytes, manifest validation and existing module analysis. The new case checks duplicate and nested paths adjacent to a similarly spelled path that can retain its layout.

Standalone Linux/Node 24.22.1 measurements ran the full layout planner on 500 synthetic captured modules per call. All modules retained their URL layouts. Each version ran in a separate process. Times are in milliseconds and peak RSS is in KiB.

Directory levels in generated suffix First call before / after 20 subsequent calls before / after Batch CPU before / after Peak RSS before / after
4 10.8 / 8.7 120.1 / 57.5 133.5 / 69.0 67,824 / 62,576
150 247.7 / 29.8 4,560.5 / 326.0 4,649.5 / 342.7 248,944 / 129,392

These timings cover planning only. Browser capture, writes, agent tokens, and real-world performance were outside the measurement.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Maintainer review and CI complete.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review November 19, 2026 05:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T05:40:10.896370Z d8c0502 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

Replaces stored directory prefixes with sorted full-path keys to reduce work when planning script exports.

  • Script exports find path conflicts by sorting full paths.

Reviews (3) · Last reviewed commit: "perf(web): reduce work for script export..." · Reviewed by Greptile

@ShuaixinHuang ShuaixinHuang changed the title perf(web): reduce work for script export path conflicts perf(web): speed up script export path conflict detection Nov 19, 2026
@morluto
morluto merged commit 9e1a84b into morluto:main Nov 19, 2026
40 of 41 checks passed
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction performance Performance regressions, scaling limits, and bounded-resource work labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants