Replies: 2 comments
-
Using puffin to profile, sorry for this pointless thread. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Note this different then my other recent thread regarding heap size
I am looking for ways to improve performance.
I have a data grid that allows for cut/copy/paste and coloring that can be unique to each cell background/foreground/text color and borders (border can be solid, dashed, etc. It works great and and I enjoy 300+ fps (cells drawn: 372, (2976 shapes/labels))
However if I change the font-size (how I choose to control zoom) to something much smaller so therefore rendering many more cells I see a reduction in fps (cells drawn: 2592, (20,736 shapes/labels))
Makes sense that the more I call ui.painter() and add things the slower the render will be but I was wondering if I am missing a way to batch everything up to improve things. I saw the LayoutJob for rendering a bunch of text together, is there something like that for shapes and lines?
The structure looks like this:
(Grid Rect): allocate_ui_at_rect
(Rows): vertical
(Row): allocate_ui_at_rect
(Cols): horizontal_top
(Cell Hover): allocate_rect
(Cell Click & Drag): interact
(Cell background): ui.painter().rect_filled
(Cell borders): ui.painter().add(line) x 4 (one for each border wall of the cell)
(Cell Contents): ui.child_ui
If the cell has focus a TextEdit::singleline is added to the child_ui scope otherwise an fn Once (typically a label is added to the child_ui's scope.
Only one TextEdit::singleline is ever present at once.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions