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
perf(elements): improve performance of real-time reporting #2498
Conversation
Why don't we implement fine-grained reactivity instead? Might be fast enough to handle big workloads without the need for throttling |
Right now, the function that costs the most performance is recalculating the metrics since that is done recursively for every item in the model (which could be a large model). I remember you told me we could mark the mutants (?) as dirty so we would only have to update the marked ones. Not sure if that would improve performance and also not sure when we would update the marked ones. This might not be the best solution, but it definitely improves performance 😃. |
That sounds like a good future improvement, but at this stage I think that might be a bit too much out of scope considering the other work that still needs to be done (real time report support in the dashboard for example). Could you accept this throttling solution in the intermediate time? |
FYI the conventional commit type should be |
1489818
to
d375624
Compare
Instead of recalculating everytime an event comes through, only event it during certain intervals. By using the `throttleTime` function from rxjs we can tell rxjs to ignore certain events during a certain time period.
Unfortunately I have to use the real SSE object, since otherwise the logic that would dispatch the event, would be gone. I still want to test more, the new listener for example.
d375624
to
181327a
Compare
|
Instead of recalculating every time an event comes through, only recalculate it during certain intervals. By using the
debounceTime
function from rxjs we can tell rxjs to ignore certain events during a certain time period.before: https://profiler.firefox.com/public/m0578rpmtf3xxvq31wfwd5927jbsdgmtcgs3ekr/calltree/?globalTrackOrder=0w2&implementation=js&thread=2&v=9
after: https://profiler.firefox.com/public/fftmqbk76rwn26g2p9wwjzwwr6ef7b6gqh052g8/calltree/?globalTrackOrder=0w3&implementation=js&thread=5&v=9
closes #2496