Tooltips severely impact scrolling performance in gridview and columnview
Steps to reproduce
- Have a big list - thousands of items - containing many labels/inscriptions with tooltips (longer tooltips seem worse)
- Scroll, especially near the middle of a very large list.
Here is a small patch that simply adds tooltips to the Lists > Characters demo in gtk4-demo that should at least help demonstrate that there is an issue.
The performance impact is also visible in nautilus in directories with many files with long filenames. Compare scrolling performance in directories seeded with these two scripts:
for ((i=1; i <= 50000; i++)); do
touch "$i"
done
and
for ((i=1; i <= 50000; i++)); do
touch "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$i"
done
Current behavior
Performance is awful with tooltips, dropping to 1-2fps or even less. Scrolling in the same conditions without tooltips present is completely smooth. Near the top or bottom edges the impact isn't large, but as you get closer to the center performance gets worse. I've even seen what appear to be lockups like #5086 (closed) mentions but only in my own application, which uses a gridview and seems unusually heavily impacted.
Expected outcome
The presence of tooltips shouldn't have a huge impact on performance when scrolling and not interacting with them.
Version information
Fedora 38, 4.10.4, i3/X11 Also git head with gtk4-demo
Additional information
No warnings or errors, even when my application appears to freeze.