Skip to content

Conversation

@LalitMaganti
Copy link
Member

@LalitMaganti LalitMaganti commented Dec 19, 2025

This change adds a new optional ClearIncrementalState method to data
source traits that allows clearing incremental state without destroying
and recreating the state object. This is useful for data sources like
track event that use large data structures (e.g., hash maps) which are
expensive to reallocate.

We also plumb this feature through to the C and Rust SDKs in the
appropriate ways for each of them.

We also implement this for the TrackEvent Data sources: this should
significantly reduce the amount of memory allocations when aggressive
intern clearing is enabled.

This change adds a new optional ClearIncrementalState method to data
source traits that allows clearing incremental state without destroying
and recreating the state object. This is useful for data sources like
track event that use large data structures (e.g., hash maps) which are
expensive to reallocate.

We also plumb this feature through to the C and Rust SDKs in the
appropriate ways for each of them.
@github-actions
Copy link

github-actions bot commented Dec 19, 2025

🎨 Perfetto UI Build

✅ UI build is ready: https://storage.googleapis.com/perfetto-ci-artifacts/gh-20735487000-1-ui/ui/index.html

@LalitMaganti
Copy link
Member Author

Thanks both! All comments should be addressed.

Copy link
Collaborator

@dreveman dreveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust SDK changes LGTM

@LalitMaganti LalitMaganti enabled auto-merge (squash) January 6, 2026 02:18
@LalitMaganti LalitMaganti merged commit 667330a into main Jan 6, 2026
23 checks passed
@LalitMaganti LalitMaganti deleted the dev/lalitm/clear-incremental-state branch January 6, 2026 02:29
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.

3 participants