Skip to content

feat: improve profile grouping output#55

Draft
piotrski wants to merge 2 commits intomainfrom
feat/profile-grouping-output
Draft

feat: improve profile grouping output#55
piotrski wants to merge 2 commits intomainfrom
feat/profile-grouping-output

Conversation

@piotrski
Copy link
Copy Markdown
Collaborator

@piotrski piotrski commented Apr 4, 2026

Summary

  • improve profiling output for repeated component names by adding grouped profile slow / profile rerenders output
  • add parent-path context and source context to make repeated rows easier to act on
  • harden metadata collection so profiling reads no longer depend on broad eager inspection or unstable overlapping inspect requests

What changed

  • preserve source metadata from inspected elements and normalize it for reporting
  • add component path helpers in the tree layer
  • group repeated profiling rows only when display name and normalized source metadata match
  • keep profile report instance-specific, but show path and src when available
  • switch inspect requests to unique request ids and add inspection caching
  • remove eager profile-start warmup and full-session metadata fan-out
  • enrich only the components needed for profile report, profile slow, and profile rerenders
  • keep --limit behavior stable after grouping by enriching a bounded candidate window and trimming at format time

Why

This addresses feedback from #54 about profiling output being hard to interpret when many repeated rows appear, especially Context.Provider-style entries with no useful grouping or hierarchy context.

Limitation

This PR uses the best identity the current backend exposes: normalized source metadata from inspectElement.

That means grouping is conservative and practical, but it is not a true runtime implementation id. We are doing the best we can without backend support for a stable component implementation identifier.

Validation

  • pnpm --filter agent-react-devtools test
  • pnpm --filter agent-react-devtools typecheck

@piotrski piotrski changed the title Improve profile grouping output feat: improve profile grouping output Apr 4, 2026
@piotrski piotrski force-pushed the feat/profile-grouping-output branch from 192e676 to 4cae176 Compare April 4, 2026 00:21
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