Skip to content

Performance fixes for larger files #1462

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Doublonmousse
Copy link
Collaborator

Fixes #1436
(and maybe #1438, waiting on a response)

  • use push_repeat for background nodes : This seems to reduce RAM usage and buffer uploads to the gpu so there's more headroom for the rest of the nodes
  • use the rtree to speed up regenerate_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 ones

On 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_comp components 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)

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
@Doublonmousse Doublonmousse added the performance Related to app performance label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Related to app performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance degrades on larger files
1 participant