Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The time panel is slow when viewing a lot of data points #619

Closed
emilk opened this issue Dec 21, 2022 · 3 comments · Fixed by #1557
Closed

The time panel is slow when viewing a lot of data points #619

emilk opened this issue Dec 21, 2022 · 3 comments · Fixed by #1557
Assignees
Labels
🚀 performance Optimization, memory use, etc

Comments

@emilk
Copy link
Member

emilk commented Dec 21, 2022

Repro: run just py-build && examples/clock/main.py --steps 250000

A lot of time is spent by the time panel to view all the data points.

The problem is that all the logged times are stored in a BTreeSet<TimeInt> which is iterated through each frame (because who knows, it might have changed since last frame).

One solution is to replace that BTreeSet with a custom hierarchial data structure where we can stop recursion when we reach some limit informed by the current zoom level, e.g. stop recursing once we reach a node that span a time that takes up less than one pixel in the time panel view. There we just summarize the children with their time span and count.

The data structure would probably be something similar to a B-tree, but we can make a lot of simplifications based on the content being POD, and that the only mutating operations is insert and trim (remove everything before time T, for memory pruning).

The primary query we need to support is to iterate through all the datapoints, but taking strides that have some fixed width (e.g. 5s).

EDIT: I have a nice idea for how to do this now, without too much work. Will perhaps work on it on the plane next week.

@emilk emilk added the 🚀 performance Optimization, memory use, etc label Dec 21, 2022
@emilk emilk mentioned this issue Dec 30, 2022
4 tasks
@teh-cmc
Copy link
Member

teh-cmc commented Jan 26, 2023

Done?

@emilk
Copy link
Member Author

emilk commented Feb 28, 2023

Not done - re_int_histogram needs to be integrated. It is another day or so of work.

@emilk
Copy link
Member Author

emilk commented Mar 9, 2023

When this issue was written, the slow portions of the viewer was the time panel.

That slowness still remain, but have been overtaken by slowness in the data store:

@emilk emilk changed the title The viewer runs slow when viewing a lot of data points The time panel is slow when viewing a lot of data points Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 performance Optimization, memory use, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants