Papirus-dark icon theme slows the system down

Sooo, yeah. I’ve noticed that opening new windows in my Gnome desktop felt kind of sluggish and I’ve decided to find out why.

I ran strace -w -c zenity --info help and noticed that there’s a LOT of file I/O calls and errors:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 51.81    0.425937         147      2878           getdents64
 30.18    0.248145         498       498           poll
  5.27    0.043301           8      5112      2143 newfstatat
  3.84    0.031592          61       512         1 futex
  2.08    0.017135          10      1677       114 openat
  1.86    0.015330           9      1568           close
  1.42    0.011645          16       722           mmap
  0.87    0.007162          14       494       258 recvmsg
  0.66    0.005408           9       578           brk
  0.51    0.004220          11       367           read
  0.38    0.003155          16       195           writev

Getting more details reveals that most of these calls are related to icon files:

$ strace --decode-fds=all zenity --info help 2>&1 | grep getdents64 
...
getdents64(11</usr/share/icons/Papirus/48x48/places>, 0x55a2dca2b6c0 /* 682 entries */, 32768) = 32752
getdents64(11</usr/share/icons/Papirus/48x48/places>, 0x55a2dca2b6c0 /* 679 entries */, 32768) = 32760
getdents64(11</usr/share/icons/Papirus/48x48/places>, 0x55a2dca2b6c0 /* 593 entries */, 32768) = 28640
getdents64(11</usr/share/icons/Papirus/48x48/places>, 0x55a2dca2b6c0 /* 0 entries */, 32768) = 0
getdents64(11</usr/share/icons/Papirus/48x48/status>, 0x55a2dca2b6c0 /* 118 entries */, 32768) = 5672
getdents64(11</usr/share/icons/Papirus/48x48/status>, 0x55a2dca2b6c0 /* 0 entries */, 32768) = 0
getdents64(11</usr/share/icons/Papirus/48x48/status>, 0x55a2dca2b6c0 /* 118 entries */, 32768) = 5672
getdents64(11</usr/share/icons/Papirus/48x48/status>, 0x55a2dca2b6c0 /* 0 entries */, 32768) = 0
getdents64(11</usr/share/icons/Papirus/64x64/apps>, 0x55a2dca94a50 /* 769 entries */, 32768) = 32760
...

Changing the icon theme to default Adwaita fixes the issue and now the system is snappy again.

A benchmark that I’ve devised is running zenity with time and pressing and holding the spacebar:

For Papirus-dark

time zenity --info help 
zenity --info help  0.43s user 0.42s system 74% cpu 1.148 total

For Adwaita:

time zenity --info help
zenity --info help  0.16s user 0.04s system 24% cpu 0.812 total

The question is… How do I fix that so I can use the Papirus theme?

Hello,
Will try to reproduce your issue, but if is indeed a bug, then here is the best place to start finding a solution

2 Likes

Maybe updating the icon cache can help?

sudo gtk-update-icon-cache /usr/share/icons/Papirus-Dark

Now it’s a little bit better, but still Papirus-Dark is visibly slower than with Adwaita

Hmm, probably the icon files are much larger than the adwaita ones in general.

Try:

sudo gtk-update-icon-cache /usr/share/icons/Papirus-Dark --include-image-data --force

Unofrtunately, this didn’t help. Still Papirus is ~2x slower

1 Like