Repository navigation
Conversation
Append each result to one array per target/file group instead of copying every earlier entry on each append. The comparator, result order, display cap and rendered output are unchanged. Fixes e2e-inc#1802
There was a problem hiding this comment.
No issues found across 3 files
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Re-trigger cubic
|
CI is green on a9db22b, and the independent review found no blocking issues. Local build, checks and the full test suite passed. The account does not have permission to add the |
okwasniewski
left a comment
There was a problem hiding this comment.
Note
Automated review.
Thanks, the fix is right. A randomized comparison of renderMarkdownReport on main vs this branch (1500 documents, up to 3000 results, several targets, repeats, hitting the display cap and the char limit) gave byte-identical output. CI is green.
Two changes before merge:
- Please drop the two new tests and the
freezehelper. The existing tests already fail on every mutation of the changed lines (dropped push, reversed order, fresh array each time). The new tests mostly pin things this PR does not touch: input immutability, which the renderer never broke, and the file/target tie-break, which is unchanged. - Make the changeset a user-facing line, e.g. "The Markdown summary renders faster for files with many results. Output is unchanged."
Optional: const grouped = byFile.get(entry.result.file); if (grouped) grouped.push(entry); else byFile.set(entry.result.file, [entry]); is shorter than the let/if block.
…geset Remove the two added tests and the freeze helper, as the existing Markdown tests already cover the changed lines. Reword the changeset for users and shorten the grouping loop; output and order are unchanged.
|
Thanks. Both changes are in:
Locally on Node 24.22.2, |
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Re-trigger cubic
What and why
fileGroupsinpackages/e2e/src/report/markdown.tscopied every earlier entry of a target/file group each time it added one, so a group of n results did O(n²) copying. Each group now owns one array that results are pushed into.patchline, as the triage comment on Performance: avoid repeatedly copying Markdown result groups #1802 asked for when output is identical.packages/e2e/tests/unit/report-markdown.test.tsis unchanged from main.Issue
Fixes #1802
Verified
Ran it locally: yes
renderMarkdownReportfrom mainb56e8ed5and from this change, then compared output for ten schema-valid workloads: identical bytes. An independent reviewer checked another 49 frozen cases, including stored CLI reports, truncation and shared references, with identical output and unchanged inputs. Sinceb56e8ed5, main has changed only import paths in these two files; the grouping hunks apply with zero fuzz.--repeat-each 2. Both wrote schema-valid reports and summaries with 14 selected, 12 executed, 8 passed, 4 planted failures and 2 skipped, and both exited 1 because of the planted failures. No browser or model was used.let/ifform of the loop, before this revision. The shorter form does the same work, because a bucket is never empty once it exists.Elapsed milliseconds per full render of the built renderer, from that
b56e8ed5comparison (Node 24.22.2, Apple M3 Pro, eight warmups, nine alternating paired samples, medians):These numbers are renderer time only. Dense one-file groups improve; small and spread-out reports show no consistent difference. They say nothing about suite, CI or memory.
pnpm bench:abwas not run. It invokese2e run --reporter json(scripts/bench-ab.ts:187), replacing the built-in Markdown reporter, and stripsGITHUB_*(scripts/bench-ab.ts:152), so the configured GitHub reporter also returns before rendering. It does not exercise the Markdown renderer.This revision on Node 24.22.2 (local commit
0d710d2f): the Markdown and reporter tests (report-markdown.test.ts,reporters.test.tsand the GitHubreporter.test.ts),pnpm buildandpnpm checkpassed. The first fullpnpm testran at a load average of 26 to 30 and failed 5 tests inmcp-test-run.test.tsandscreenshot-assertions.test.ts. Run alone,screenshot-assertionspassed, whilemcp-test-runfailed first on a tap that timed out after 235 ms, then on a session-slot cascade. The second full run, at a load of about 5, passed everye2etest but failed 27webCDP and download tests, because the Playwright Chromium binary was missing until partway through that run. With the browser confirmed present, the four affectedwebfiles passed (32 tests), and one more fullpnpm testexited 0:e2e4,673 passed, 11 skipped;web832 passed, 1 skipped; every later package andtest:scriptspassed.