Closed JanBliznicenko closed 6 months ago
Hi Jan, thank you very much for you feedback. Dirty rectangle is new experimental feature. It allows to users only redraw what has changed in the visualization. I will profile your examples and numbers to find a solution tomorrow
Also please note that for big visualizations like example example01BigVisualization131k, you can use useRTree
Users of roassal can use the RTree
or the List
collection for drawing and search elements in the canvas space. You can use it in RSCanvas
or in RSComposite
.
The difference is huge.
|canvas boxes lines|
canvas := RSCanvas new.
canvas useList.
canvas useRTree.
"15K elements"
boxes := (1 to: 15000) collect: [:i | RSBox new translateBy: i @ i; yourself ].
canvas addAll: boxes.
canvas nodes @ RSDraggable new.
canvas open.
https://github.com/pharo-graphics/Roassal/assets/10532890/af645b4d-52c0-4791-9060-ba4d97356691
@JanBliznicenko the problem is that now for drawing and events we use the shape collection, then specially if you are using big visualizations you have to use canvas useRTree
.
Please let me know if this change work for your project so we can close this issue
with @tesonep we saw the problem
@akevalion Thank you for looking into that. Does useRTree
help you for my examples? In my case, they actually take more time.
It helps the OpenPonk itself, but it is still not as fast as it used to be before using dirty rectangles and explicitRequirements.
Moved to Roassal3
There is a significant slowdown between between first and last commits in this new repo that seems to be caused by a combination of dirty rectangles and using
explicitRequirements
.The slowdown is quite situational, but causes dragging elements in larger OpenPonk diagrams to degrade from quite fluent high-FPS experience to something hitting 1-3 FPS.
It is most noticable when dragging elements manually. Use
RSRenderTreeExamples new example01BigVisualization131k
and try to drag a single element around. In current master (or 3a0cdc0) it is quite sluggish while in b508334 with all methods withexplicitRequirements
removed, it is completely fluent.To have some automatically executed example, I created 2 examples and created 4 images based on Pharo 11.
These are the two examples:
Boxes example:
Lines example:
Boxes example:
Lines example:
Code that removes those explicitRequirements: