Improve flight mode tracing performance for large tracings #3880
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.
This PR includes a couple of performance optimizations:
existsCache
from the diffable_map. Cloning this map was a major performance bottleneck. When setting we now no longer know whether the key already exists and need to search through all chunks, but that is much faster than the cloning. Also, much less garbage collection during the performance measurement (from up to 20% down to 5%). This change had the biggest positive performance impact :)I tested this with an 80.000 node tracing. FPS during flight mode tracing increased from ~3-7FPS (and hefty lag) to ~17-22FPS, where smooth tracing is very possible :)
I also tested whether tree split performance was affected by the changes, which it was not (but it is and was rather slow).
Not sure whether this will also fix the crash that was reported, probably not :/
URL of deployed dev instance (used for testing):
Steps to test:
Issues: