forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance of time panel (rerun-io#8224)
### Related * More optimization depends likely on rerun-io#8221 ### What Make the timepanel faster. Still plenty of room for improvement though. Achieved by... * store subscriber to keep track of cumulative chunks needed for a given entity & timeline * plus some statistics. less important * a bit faster `num_events_cumulative_per_unique_time_unsorted` * improved `DensityGraph::add_range` (this one was surprisingly significant) ### Testing TL;DR: Minimized timepanel takes less than half the time it use. Other cases are better as well, but more noisy. ---- All testing done on the 2h airtraffic dataset (pre-saved rrd) with all panels hidden and views removed (unless noted otherwise) on my M1 Max. Note that the timeline perf is very dependent on amount of screen real estate - these tests were done maximized on the 14'' Mac's screen. (Did some throw-away testing on other configs, but these are the ones we're comparing here!) This round of optimization focused mostly on the "idle" case of having the time panel minimized. There are also some gains for the expanded case, but it's less significant - as illustrated by the profiler screenshots this is largely dominated `num_events_cumulative_per_unique_time` which I hope we can solve with chunk processors (and some untracked overhead I haven't looked into yet). **Before:** Frame cpu time without profiler attached hovers around 4.2ms with some outliers. <img width="169" alt="image" src="https://github.com/user-attachments/assets/0cfead2d-b485-45e8-b864-390cc8acd341"> Attaching the profiler doesn't tell us much since the profiler overhead drowns out everything else: ![image](https://github.com/user-attachments/assets/db688dc3-c0bc-449a-a9d7-cce192cfec30) Restarting without profiler and expanding the time panel and making it as high as possible gives us about 12ms with frequent spikes beyond 13ms <img width="1798" alt="image" src="https://github.com/user-attachments/assets/5732a1ed-9911-4dbe-ae15-c52c9d0e4eeb"> Profiler overhead is ironically not _as_ significant. Averaging a few frames tells us the time panel is at 11.5ms ![image](https://github.com/user-attachments/assets/6186da15-faa9-469c-8e80-b12184ae1689) **After** Frame cpu time without profiler attached hovers between 1.5ms and 2.8ms, rather unsteady <img width="124" alt="image" src="https://github.com/user-attachments/assets/9d709888-0b48-4404-a570-417677175202"> Averaging a bunch of frames tells us that the data_density_graph takes now 0.55ms (imho still pretty bad for that it is) ![image](https://github.com/user-attachments/assets/37cf9d75-7023-41d9-967c-7555b6fc0740) Restarting without profiler and expanding the time panel and making it as high as possible gives us around 11ms <img width="1798" alt="Screenshot 2024-11-26 at 15 45 20" src="https://github.com/user-attachments/assets/f4eab17f-db0e-4a21-86d9-5ac47560d7d0"> (important: this picture hasn't changed otherwise!) The time panel now takes 9.4ms (that is definitely still very bad!), profiler overhead is still significant but it's manageable: ![image](https://github.com/user-attachments/assets/0f4375e8-cc76-40c1-9f7f-049e5a4c4640)
Showing
12 changed files
with
513 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.