clutter/text: Check if attributes are equal before applying
Pango doesn't make it easy but the lists are generally extremely
short and it's worth the effort. Because when they are equal we
can avoid the clutter_actor_queue_relayout
in
clutter_text_set_attributes
. This particularly avoids stuttering
when moving the mouse over the gnome-shell calendar (which repeatedly
sets font-feature-settings: "tnum"
on calendar-day-base
themed
widgets).
Closes: gnome-shell#1411 (closed)
Before:
*** Performance over 1.0s: 51.07 FPS, update time avg: 4.1ms, peak: 16.1ms
*** Performance over 1.0s: 47.59 FPS, update time avg: 8.6ms, peak: 15.9ms
*** Performance over 1.0s: 43.79 FPS, update time avg: 8.5ms, peak: 16.0ms
*** Performance over 1.0s: 48.94 FPS, update time avg: 6.6ms, peak: 15.8ms
After:
*** Performance over 1.0s: 59.92 FPS, update time avg: 1.1ms, peak: 3.5ms
*** Performance over 1.0s: 59.91 FPS, update time avg: 2.1ms, peak: 3.3ms
*** Performance over 1.0s: 59.94 FPS, update time avg: 2.1ms, peak: 3.3ms
*** Performance over 1.0s: 59.97 FPS, update time avg: 2.3ms, peak: 3.3ms
Edited by Robert Mader