You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`--no-timing` -- skip the per-page `console.log` relay from
38
-
`timing-handler.js`. The relay costs ~2 % of render self-time on
39
-
the 1638-page book and muddies the bottom-up view.
40
43
-`--render-only` -- bail out after `PagedPolyfill.preview()`
41
44
returns. Skips meta extraction, `parseOutline`, `page.pdf`, and
42
45
the pdf-lib roundtrip / incremental writer. ~47 s saved per run
@@ -66,7 +69,7 @@ The harness and core probes:
66
69
| --- | --- |
67
70
|`measure.mjs`| Puppeteer harness. Drives the same flow as `docs/render-book.mjs` (loads the vendored paged.js bundle, runs `PagedPolyfill.preview()`, calls `page.pdf()`, then either the pdf-lib roundtrip or the incremental writer), with optional CPU profiling, in-page handler injection, and DOM-accessor instrumentation. Auto-pins to a fixed core mask on Windows via `pin-cpu.mjs` (see below) for stable measurements; pass `--no-affinity` to opt out. |
68
71
|`pin-cpu.mjs`| Shared shim used by `measure.mjs`, `profile-load.mjs`, `profile-roundtrip.mjs`, and `ab-css.mjs`. On Windows, auto-relaunches the parent Node process under `start /affinity 0x5500 /high` (cores 4-7 physical, thread 0 each, on an 8C16T AMD Ryzen 7) so puppeteer's Chromium children inherit the mask + priority at spawn time. Reduces single-run CPU sample-time variance from ~15-25 % on a stock dev box to ~3 %. No-op on non-Windows; opt out per-invocation with `--no-affinity` or `PERF_PINNED=1`; override mask with `PERF_AFFINITY=<hex>`. |
69
-
|`timing-handler.js`|`Paged.Handler` that records per-page wall time + heap into `window.__pagedTiming` and streams a line per page to the console. Always injected. |
72
+
|`timing-handler.js`|`Paged.Handler` that records per-page wall time + heap into `window.__pagedTiming` and streams a line per page to the console. Injected when `--timing` is passed; off by default because the per-page console relay costs ~2 % of render self-time. |
70
73
|`detach-pages.js`|`Paged.Handler` that hides each completed page from the layout tree (registered against `finalizePage`). The shipping fix. Injected by default (both by `measure.mjs` and by `docs/book.bat`); pass `--no-detach-pages` to measure the pre-fix baseline. |
71
74
|`instrument-flush-ops.js`| Wraps `getComputedStyle`, `getBoundingClientRect`, and the `offsetWidth` / `clientWidth` / `scrollWidth` family with counters + per-call timing. Injected by `--instrument`. |
72
75
|`instrument-detach.js`| Counters around `detach-pages.js`'s removeChild / restore cycle. |
@@ -168,6 +171,7 @@ run.bat # defaults to ..\docs\_site-pdf\book.h
168
171
run.bat path\to\some-other.html # explicit input
169
172
run.bat --out my-run # explicit output directory
170
173
run.bat --no-detach-pages # opt out of the detach-pages fix (measure pre-fix O(n²) baseline)
0 commit comments