Skip to content

Experiment: CPU profile of the no-glint bench case - #59

Closed
johanrd wants to merge 4 commits into
mainfrom
experiment/noglint-cpu-prof
Closed

Experiment: CPU profile of the no-glint bench case#59
johanrd wants to merge 4 commits into
mainfrom
experiment/noglint-cpu-prof

Conversation

@johanrd

@johanrd johanrd commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Temporary experiment, closed on purpose. The no-glint CPU profile workflow builds main as control next to this branch (= release-0.9-fixes + the workflow), runs the bench's no glint case three times per side under node --cpu-prof, prints wall times and the top self-time functions in the job summary, and uploads the .cpuprofile files as the noglint-cpuprofiles artifact (open in Chrome DevTools > Performance > Load profile).

Context: #58's bench comparison shows no glint +13–17 % on CI twice while it is −1 % locally; the closure is not computed in that case (HVE_NO_CACHE=1), so the cause is unknown. Re-run from the Actions tab (workflow_dispatch) as needed.

- The closure is part of the transform and report keys with Glint off
  too: the resolver reads an imported component's template to
  substitute its tag.
- A `.ts`/`.js` module's co-located `.hbs` template (next to it or under
  `templates/components/`) and `/// <reference path>` targets are part
  of the closure. Without a tsconfig, relative imports still resolve.
- The lockfile is found at or above the tsconfig directory (workspace
  root). A nested directory with its own package.json is not walked for
  project-wide inputs.
- The tsconfig sha covers the whole `extends` chain and is re-validated
  against the file system; `backendKindFor` makes the same decision as
  `selectBackend` (a TypeScript 7 package that does not load falls back
  to ts6 in both).
- A result computed after a Glint extraction threw is not cached at any
  level; the next run retries.
- Long-lived hosts: the project-wide input list re-validates on the
  mtimes of the directories walked; an `index` probe watches the
  directory it lives in; trailing commas are removed outside strings
  only; file records keep import lists, not content.
- The CLI computes report keys before the Glint preload and preloads
  the misses only; `dependencySha` is memoised per content under a
  static file system. `--help` names all three caches.

Cowritten by Claude
…ndows separators

Copilot review on #58: the string-safe JSONC scanner only skipped whitespace when
looking for the closing bracket, so `{ "a": 1, // note\n }` kept the comma and
JSON.parse failed after comment removal. The templates/components peer regex was
POSIX-only, dropping the classic-layout peer from the closure on Windows.
The cache-key component loaded typescript-7's sync and ast modules
(~30 ms) on every process, including replays that never need a backend.
Whether the package loads is decided by its version and the Node version,
so both are in the key and the package is only resolved.
@johanrd

johanrd commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

Closed on purpose — experiment only; see the workflow run and artifact.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant