[performance] take a shortcut for viewport changes
With big diagrams, scrolling and zooming gets very slow as we recalculate and patch the entire tree. We should add so kind of shortcut for changes that just affect the viewport.
Hello @spoenemann, @JanKoehnlein , I am currently working on icreasing the performace. The Main Problem for large graphs are Zoom actions right now, resulting in setviewport actions that are done one after another. The Idea we had was to make a delay (5-20ms) so that one can make a list of setviewport actions in the Mouse Tool and then merge those in a good way :) Is that a change that should bei added to sprotty? Then i would try and rewrite Part of the Mouse Tool !
Greate regards Felix
The merge method is used to merge multiple commands within the same animation frame:
https://github.com/eclipse-sprotty/sprotty/blob/6d43db24c67c4adc837ea9e8a775f47ded5c5193/packages/sprotty/src/base/commands/command.ts#L108-L118
As to the proposal to take a shortcut for viewport changes: This would break the implementation of Level-of-Detail rendering, i.e. omitting selected details when the user has zoomed out. We already have that in our Multicore example.
There are already other ways to improve the performance for large graphs, and those work for all diagram interactions, not just viewport changes. I had a presentation about that together with @jbicker at EclipseCon 2023, and we're going to publish a blog post at https://www.typefox.io/blog/ soon.