Performance fixes for larger files#1462
Conversation
flxzt
left a comment
There was a problem hiding this comment.
when this lands these are nice improvements to the rendering part of the engine. I added some comments
|
Only storing non-trashed strokes in the R-Tree is problematic and will require additional changes in other parts - essentially everywhere where one of the methods of |
|
I'm trying to rely more on the keytree to get stroke bounds whenever possible (as calculating a bunch of stroke bounds on each event is potentially pretty expensive). Testing the two keytree solution, I'm encountering quite weird results with the splitting eraser |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
good to know, but not really relevant for the technical discussion this PR should focus on @Intranox |
|
Rebased on main. New thing: opening the visual debug panel triggers the following message: *** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debugSeems to be caused by the rectangle holding the statistics. Not sure if this is from this PR or not (maybe since a specific gtk version? Found https://github.com/fpaquet/gtksheet/pull/21/files and https://gitlab.gnome.org/GNOME/gtk/-/issues/6338) |
7c321f4 to
389af82
Compare
|
Rebased onto 0.14.2 |
This diminishes the cost for this - one element of somewhat fixed size (no vec pushing) - one element given to gtk that can tile this as it pleases with less buffer pushes
We use the rtree to find the element in the viewport, mark these ones using a hashmap, call the rendering function, then remove the rest by iterating on the keys a second time, filtering on keys not in the hashmap
Do not leak key trees out of the store structure
389af82 to
bda5b84
Compare
… `push_repeat` instead) `push_repeat(x,None)` will take the whole not and repeat it
And remove now superfluous filters on the trash status for the outputs of the `key_tree`
…ectly The information is there already, and it is probably more effective to get the value from the keytree rather than recalculating it on the fly on each event
bda5b84 to
3677b8c
Compare
3677b8c to
5d1ec67
Compare
|
Rebased after #1776 |
Fixes #1436
(and maybe #1438, waiting on a response)
push_repeatfor background nodes : This seems to reduce RAM usage and buffer uploads to the gpu so there's more headroom for the rest of the nodesregenerate_rendering_in_viewport_threaded: We use the rtree to get the strokes in the viewport without recalculating any stroke bounds, and get the ones not in the view by iterating on keys and using a hashmap to filter out the previously selected onesOn that subject, it seems we could use a https://docs.rs/slotmap/1.0.7/slotmap/sparse_secondary/struct.SparseSecondaryMap.html for the render components and/or be smarter on clearing the
render_compcomponents of strokes (we know there's no work to do if we have x strokes in view that we just initialized the rendering components and x strokes in the rendering component slot)I've updated the rtree to only keep bounds for visible strokes (so trashed strokes are removed from the tree)
I've also added to the visual debug mode a way to see the envelope of the whole rtree (marked by orange bounds)