Refactors activity filtering to happen sooner #48
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.
Based on my contribution in microsoft/vcperf@a02d588.
Moves activity filtering (
FunctionandTemplateInstantiation) 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
TimelineEntryinstances 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
BandEevents, when it should've been anXevent. Now, because that same entry effectively has no children when we get to export it, will use the correct event type. This makes.jsontraces a bit smaller as well (how small depends on the number of filtered entries).