-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Dynamic interval tree #152
Comments
Hello @cristiano-belloni. Why not. Do you have a precise use case in mind? Also do you have an implementation in mind? Dynamic interval tree can be implemented in many ways and must be tailored to use cases typically. |
My use case would be dynamically scheduling note events within a multi-track timeline. As the timeline is playing (real-time), a user could move the notes and change the interval data structure. Normally this is implemented with a lookahead firing every n milliseconds, and it'd be cool to have a data structure that can return the notes to be played in the next lookahead interval. In his case, there would be many read requests (one per lookahead) and less writes (one per user interaction), so I guess a computationally read-friendly structure would be optimal. |
So I guess your structure would need to a large amount of items? I am saying this because for some use cases, linear search in an array is sometimes faster in JavaScript if you only keep few items. |
What I mean is that the perf tradeoff is rarely obvious in JavaScript for typical interval tree use cases because their implementations are complex and require a lot of operations that muddle the |
Ah that's good to know. I guess items could be in the 1000s. Not worth it? |
Probably not. But since you are going to fire your search very frequently it might still be. Your mileage may vary. But you should definitely try a naive linear search implementation (maybe using something allowing for easy deletion rather than an array) and see if this is a perf bottleneck or not before trying to roll a dynamic interval tree. |
An interval tree that can be dynamically edited (ie add / delete / modify intervals).
The text was updated successfully, but these errors were encountered: