Skip to content

Conversation

@MetanoKid
Copy link
Owner

Based on my contribution in microsoft/vcperf@a02d588.

Moves activity filtering (Function and TemplateInstantiation) to happen as soon as activity stops instead of keeping everything in memory alongside a list of filtered activities that only get applied when exporting.

Now, we keep less things in memory and iterate over less entries when exporting, making the overall process faster. In fact, in my old laptop it's two orders of magnitude faster when analyzing a 3.3 GB trace full of small functions.
Not only that, but my laptop doesn't page memory with that trace anymore, which heavily impacts speed. It created so many TimelineEntry instances that it would take over 30 minutes after the execution had finished just executing destructors and all.

As a side-effect, this PR fixes a bug where an entry with filtered out children would get exported as a pair of B and E events, when it should've been an X event. Now, because that same entry effectively has no children when we get to export it, will use the correct event type. This makes .json traces a bit smaller as well (how small depends on the number of filtered entries).

@MetanoKid MetanoKid merged commit cc71025 into master Aug 20, 2020
@MetanoKid MetanoKid deleted the filtering-sooner branch August 20, 2020 17:35
@MetanoKid MetanoKid added this to the v1.0.0 milestone Aug 20, 2020
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.

2 participants