-
I have a PlayerStatus struct that is updated every 200ms in native code, containing progress and duration fields. The progress field updates frequently, while duration changes only when the soundtrack changes.
I'm concerned about performance and want to avoid wasting CPU power on unnecessary updates. When updating the PlayerStatus, I'm curious if it triggers redraw or relayout of progress-related widgets. To optimize performance, I'm considering splitting the struct into frequent and rare update categories. The goal is to update progress-related widgets more frequently without impacting widgets related to the rarely changing duration. Any insights or suggestions on how to achieve this efficiently? Your input is much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As of now, Slint checks when setting a property if it is the same value or not. If not the same value, all dependent property becomes dirty. and the properties that depends of these dirty property too, even if the property would not change. So yes, splitting the struct will help. |
Beta Was this translation helpful? Give feedback.
As of now, Slint checks when setting a property if it is the same value or not. If not the same value, all dependent property becomes dirty. and the properties that depends of these dirty property too, even if the property would not change.
So yes, splitting the struct will help.