WIP: js: Avoid toggling reactive during animations [performance]
The reactive
property was being toggled approximately 50 times
(twice for each icon plus the AllView) during the spring animation. And
mostly at different times as icons completed the animation at different
times, so not in the same frame.
The problem was that toggling reactive
on an StWidget incurs a style
change of the insensitive
pseudo class, and style changes would quickly
queue relayouts incurring full stage reallocation. This occurred many times
over the course of one spring (or pulse) animation hogging the CPU and
limiting the frame rate.
We need the insensitive
pseudo class to work, so changing that in
response to reactive
is correct. However we don't need to do the
reactive
toggling at the start or end of the animations because those
always start or end with the actor changing visibility too.
So by removing the reactive
toggling during animations we can avoid
the CPU burden of multiple full stage relayouts mid-animation, and achieve
a higher frame rate.
Results from one machine:
Before: 44 FPS, relative CPU time painting: 11%
After : 55 FPS, relative CPU time painting: 20%
TODO: Find out what the remaining causes of relayout/allocation are (seem to be direct calls from JS). And if possible add a second commit to reduce those.
Helps with mutter#232 (closed) and mutter#233 (closed).