Skip to content

cpu: bucket non-fetchable script URLs by scheme + counts-only record lane - #1

Merged
jantimon merged 2 commits into
mainfrom
feat/blob-cpu-attribution
Jun 30, 2026
Merged

cpu: bucket non-fetchable script URLs by scheme + counts-only record lane#1
jantimon merged 2 commits into
mainfrom
feat/blob-cpu-attribution

Conversation

@jantimon

Copy link
Copy Markdown
Owner

Hit this profiling a real blob-iframe SPA: only blob: was bucketed, so data:/inline ESM, wasm://, and v8//extensions:: frames fell through to fs package resolution and got blamed on the cwd package (wpd's own — 58% of one profile). Now they bucket as (inline)/(wasm)/(native), we check the original callFrame.url (an inline module's sourcemap can fill frame.source and hide the scheme), and the base64 payload is trimmed out of the stored source.

That same page OOMs the renderer under DevTools tracing, so:

  • --no-trace — CDP counts + optional --cpu-profile, no trace buffer
  • --no-invalidation-tracking — drop the heavy category
  • --protocol-timeout <ms>

unit test added, 18/18, lint + format clean.

jantimon added 2 commits June 29, 2026 12:50
A same-process iframe built from a Blob (e.g. an embedded dashboard) reports
blob: script URLs. These previously fell through to the local-path branch, where
package resolution walked the filesystem up to the nearest package.json and
mis-blamed the iframe's CPU self-time on an unrelated package (often wpd's own).
Bucket them as (blob) in query cpu instead. Also gitignore .wpd-profile/.
…ord lane

generalize the blob: fix: data:/inline ESM, wasm://, and v8//extensions:: frames
were falling through to fs package resolution and getting blamed on the cwd
package (wpd's own). now bucket as (inline)/(wasm)/(native), check the original
callFrame.url, and trim the base64 payload out of the stored source.

also add --no-trace (CDP counts + optional --cpu-profile, no trace buffer),
--no-invalidation-tracking, and --protocol-timeout for pages whose trace pass
OOMs the renderer. unit test added.
@jantimon
jantimon merged commit 2d90e93 into main Jun 30, 2026
2 checks passed
@jantimon
jantimon deleted the feat/blob-cpu-attribution branch June 30, 2026 07:44
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