cpu: bucket non-fetchable script URLs by scheme + counts-only record lane - #1
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hit this profiling a real blob-iframe SPA: only
blob:was bucketed, sodata:/inline ESM,wasm://, andv8//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 originalcallFrame.url(an inline module's sourcemap can fillframe.sourceand 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.