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))
![img_3](https://private-user-images.githubusercontent.com/70674808/372248728-138ba953-ee1b-4122-975a-ad0312ebb8f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQzODc4MzUsIm5iZiI6MTczNDM4NzUzNSwicGF0aCI6Ii83MDY3NDgwOC8zNzIyNDg3MjgtMTM4YmE5NTMtZWUxYi00MTIyLTk3NWEtYWQwMzEyZWJiOGY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjE2VDIyMTg1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEwMjQ3Mjc2YzY5NDU2M2FiZGJkNjFiODQ5YzJlNmNkNzlkYzZmZDU0NmRlYTk2M2U0MzA1NGFhODI0ZWZkOGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-2XeYxnNEUCSU--sPu4OevA37WV_nNDZpdgOIpzTzRY)
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))
![img_4](https://private-user-images.githubusercontent.com/70674808/372248750-790a13e8-2998-4811-8ecb-b7446a012921.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQzODc4MzUsIm5iZiI6MTczNDM4NzUzNSwicGF0aCI6Ii83MDY3NDgwOC8zNzIyNDg3NTAtNzkwYTEzZTgtMjk5OC00ODExLThlY2ItYjc0NDZhMDEyOTIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjE2VDIyMTg1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkZjUyNTFhODQ5OTY1NjcwZWYzYTQ1YTQyMTYwYTJiNTJiYTY0OTgxMWFjNzZhZWNkZTAxNjc1YTcyOTk2M2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Lxvv55TEHjy5vw9PV06UeC3z2M-q5yN6u_dveuA7ihU)
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