GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(server): HTML renders with large comments prepare 7x faster by trevoedwards · Pull Request #43873 · pingdotgg/t3code Conversation
Contributor
ProblemBefore Found by profiling
FixBlank each run of characters other than CR and LF with one The existing inlining test now puts an emoji (a surrogate pair) and a CRLF inside its commented-out image. The test then checks that the image after the comment is still replaced at the right offset. A change that counts code points instead of code units shifts those offsets and fails it. I also measured skipping the scan when the raw page has no quoted absolute path and no VerificationAll runs used synthetic data in a disposable Docker container (
"Output hashes" compares the SHA-256 of
Written by Claude Opus 5.5 (high) running in Claude Code (Claude Agent SDK) inside T3 Code.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsfindLocalImages blanked each HTML comment one character at a time before scanning for local images, which took most of HtmlRender.prepare for pages with large comments (about 1.5 s for a 24 MiB comment). Blank each run of non-line-break characters at once; the masked string, and every offset used to inline images, is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
There was an error while loading. Please reload this page.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Preserve line endings when masking comments apps/server/src/htmlRender/HtmlRender.ts, apps/server/src/htmlRender/HtmlRender.test.ts |
findLocalImages replaces non-newline runs in comments with equal-length spaces, preserving carriage returns and line feeds. The test checks that the commented-out image remains unchanged in prepared HTML. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Refactor
Possibly related PRs
Suggested reviewers: saphid, iamshadmantaqi
8bd74This change speeds up comment masking when preparing large HTML while keeping image-inlining behavior the same. No merge-blocking risk was found.
Explanation
The title "fix(server): HTML renders with large comments prepare 7x faster" matches the main change. The PR replaces per-character comment masking in findLocalImages with per-run masking, which speeds HtmlRender.prepare for pages with large HTML comments. The title follows conventional commit form and names the server scope and the performance gain. The title is slightly awkward in its phrasing ("HTML renders with large comments prepare 7x faster"), but it is specific and related to the change.
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the slow per-character masking with measurements. The Change section explains the run-based fix and why offsets stay the same. The Scope section links the issue #43134 as the bug reference. The Verification section lists focused test runs, a mutation check, benchmark tables, and output hash comparisons. The template's conventional commit title example is followed by the title. The description does not include the model attribution template line in the required form, but it does include an attribution line at the end. Some sections are long, but the required information is present.
2fd1c881-7691-41ac-a98e-5102fa01be9eapps/server/src/htmlRender/HtmlRender.test.tsapps/server/src/htmlRender/HtmlRender.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
EvidenceMeasured the production
Values are medians of six round medians from the confirmation run. Median reductions were 209.0 ms and 1097.9 ms, exceeding the largest corresponding round-median spreads of 137.8 ms and 765.2 ms. Base/head round-median ranges did not overlap. Output SHA-256 matched across both commits and all calls in both runs. An initial six-round run showed timing drift; its 4 MiB aggregate gain narrowly missed the full-range spread criterion. The identical protocol was repeated, and both runs are retained in the comparison transcript and raw measurements. Scripts: production-service driver, paired-run launcher, measurement summarizer. Not shown:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
…dotgg#43873) Co-authored-by: Trevor Edwards <[email protected]> Co-authored-by: Julius Marminge <[email protected]> (cherry picked from commit a4f7b1e)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.