WIP: Improve css state tracking
The main goal in this branch is to reduce the amount of style recomputation that is done on frequent state changes.
Numbers from widget-factory with Adwaita:
2247 nodes
Change | Before | After |
---|---|---|
class | 612 | 612 |
name | 2246 | 2246 |
id | 2 | 2 |
first-child | 148 | 148 |
last-child | 156 | 156 |
state | 2247 | 2245 |
hover | 2247 | 562 |
disabled | 859 | |
backdrop | 1080 | |
selected | 579 | |
sibling-name | 63 | 63 |
sibling-state | 51 | |
sibling-disabled | 51 | |
parent-class | 586 | 586 |
parent-name | 788 | 788 |
parent-id | 2 | 2 |
parent-first-child | 78 | 78 |
parent-last-child | 78 | 78 |
parent-state | 2226 | 115 |
parent-hover | 5 | 5 |
parent-disabled | 91 | |
parent-backdrop | 4 | |
parent-selected | 144 |
The important number here is parent-state, since any node with parent-state in its changes will recompute its style when the state of the toplevel (or any other ancestor) changes, e.g. when going to backdrop, or when moving the mouse out.
The number goes from 2226 to 115.
Edited by Matthias Clasen