You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a performance issue while working on a project where I utilized two identical buttons with all properties set the same. The only difference was in the content: one button utilized a PathIcon inside a Viewbox, while the other utilized a templated control called SvgIcon, which also encapsulated the same PathIcon inside a Viewbox. Surprisingly, I noticed a significant time discrepancy between the two implementations, with the templated control taking longer.
Here's a breakdown of the performance observation:
Button 1: Utilized a PathIcon inside a Viewbox.
Button 2: Utilized a templated control called SvgIcon, which also contained a PathIcon inside a Viewbox.
Both buttons had identical paths for their content.
Upon profiling the application, I found that the templated control (SvgIcon) alone consumed approximately 0.52 milliseconds more time compared to directly using PathIcon inside Viewbox.
When utilizing these controls within a ListView, the impact on performance becomes more noticeable.
I'm seeking insights into why there's a performance disparity between these seemingly similar implementations. Could anyone give potential reasons for this discrepancy and suggest optimizations to mitigate the performance overhead introduced by the templated control (SvgIcon) when used within a ListView?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I encountered a performance issue while working on a project where I utilized two identical buttons with all properties set the same. The only difference was in the content: one button utilized a PathIcon inside a Viewbox, while the other utilized a templated control called SvgIcon, which also encapsulated the same PathIcon inside a Viewbox. Surprisingly, I noticed a significant time discrepancy between the two implementations, with the templated control taking longer.
Here's a breakdown of the performance observation:
Button 1: Utilized a PathIcon inside a Viewbox.
Button 2: Utilized a templated control called SvgIcon, which also contained a PathIcon inside a Viewbox.
Both buttons had identical paths for their content.
Upon profiling the application, I found that the templated control (SvgIcon) alone consumed approximately 0.52 milliseconds more time compared to directly using PathIcon inside Viewbox.
When utilizing these controls within a ListView, the impact on performance becomes more noticeable.
I'm seeking insights into why there's a performance disparity between these seemingly similar implementations. Could anyone give potential reasons for this discrepancy and suggest optimizations to mitigate the performance overhead introduced by the templated control (SvgIcon) when used within a ListView?
Beta Was this translation helpful? Give feedback.
All reactions