Skip to content

ui: optimize BreakdownTracks and AndroidBinderViz performance#6055

Draft
gignat-dev wants to merge 1 commit into
mainfrom
dev/gignat/breakdown_tracks_sort_cache
Draft

ui: optimize BreakdownTracks and AndroidBinderViz performance#6055
gignat-dev wants to merge 1 commit into
mainfrom
dev/gignat/breakdown_tracks_sort_cache

Conversation

@gignat-dev
Copy link
Copy Markdown
Contributor

Significantly reduce the time it takes to load traces with large breakdown track hierarchies (like Android Binder) through projected-path caching and batched operations.

Implementation details:

  • Projected Path for BreakdownTracks: Instead of running the expensive intervals_overlap_count macro O(N) times (once per track node), pre- calculate all intersections upfront into a shared temporary table. Individual tracks now just run a cheap filter/aggregation against this table.
  • Sort Cache Optimization: Pre-computes the max values for sorting tracks using a single batched query instead of O(N) sequential queries.
  • Batch SQL Table Creation: On the legacy path, CREATE PERFETTO TABLE statements for counter tracks are accumulated and flushed to the engine in a single batched query.
  • Parallelize Binder Tracks: The AndroidBinderViz plugin kicks off both server and client track hierarchies concurrently using Promise.all.
  • Enable sorting for AndroidBinderViz now that sortTracks is O(1) round-trips.

Significantly reduce the time it takes to load traces with large breakdown
track hierarchies (like Android Binder) through projected-path caching and
batched operations.

Implementation details:
- Projected Path for BreakdownTracks: Instead of running the expensive
  intervals_overlap_count macro O(N) times (once per track node), pre-
  calculate all intersections upfront into a shared temporary table.
  Individual tracks now just run a cheap filter/aggregation against this
  table.
- Sort Cache Optimization: Pre-computes the max values for sorting tracks
  using a single batched query instead of O(N) sequential queries.
- Batch SQL Table Creation: On the legacy path, CREATE PERFETTO TABLE
  statements for counter tracks are accumulated and flushed to the engine
  in a single batched query.
- Parallelize Binder Tracks: The AndroidBinderViz plugin kicks off both
  server and client track hierarchies concurrently using Promise.all.
- Enable sorting for AndroidBinderViz now that sortTracks is O(1) round-trips.
@github-actions
Copy link
Copy Markdown

🎨 Perfetto UI Builds

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