GNOME Bugzilla – Bug 658995
Font Picker Dialog to change application fonts in gnome-tweak-tool takes ages to load
Last modified: 2011-09-27 09:19:34 UTC
1. Load the gnome-tweak-tool (Advanced Settings) 2. Go to "Fonts" 3. Click on the combobox to change the "Default Font" 4. Wait about 2 minutes 5. Eventually, the new font picker dialog loads up. 6. Repeat process for every font in the UI I want to change. I have quite a large library of fonts. I'm wondering if the font picker is loading/refreshing the cache of fonts every time?
That's nice, but nothing whatsoever to do with gnome-control-center.
-> gtk+
Apologies for filling this in the wrong place, as this is my first attempt at filing a bug for GNOME, I had no idea where to file this.
Out of interest, how many fonts do you have ? fc-list | wc -l will tell you
3,575. I've been talking with Mathieu Comandon about this bug on Google+. He recommended I rename my .fonts directory (where all MY fonts are) to .fonts.backup and try the font picker in Advanced Settings again. This time, the font picker dialog takes maybe a second to load if that. Mathieu concluded that it's either a problem with the size of my library or one or several "problematic" fonts. For extra info: I use my fonts with GIMP, Inkscape and ScribusNG. Scribus as no problems with my font library. Inkscape takes maybe 30-45 seconds to load but I think that's a known bug. GIMP has no problems with my font library apart from a slightly sluggish scrolling performance in the GIMP font picker tool.
(In reply to comment #3) > Apologies for filling this in the wrong place, as this is my first attempt at > filing a bug for GNOME, I had no idea where to file this. Don't worry, I do that all the time myself :) Bugs are easy to reassign to the right component, and that seems to have been done for this bug.
I've been meaning to find some time to look at this. At some point during the development of the dialog things started to go really slow. I'm not an expert debugging performance issues but I'll try to do my best. I need to find some time to fix other font issues anyway.
Well, we are blocking while iterating over all fonts. And we are doing it again, whenever anything changes. There's several easy wins here, like moving the filter function to the filter model, and only refilter when it changes. And don't redo everything when the style changes (because that might just cause us to select a different default, I think). And figure out why we are currently doing populate_list twice before the widget is shown. And finally, break the font list into chunks and deal with it incrementally.
I've just pushed a performance overhaul of the code to master. Time to run tests/testfilechooser, letting it idle for a minute and then closing it went from real 1m0.000s user 0m37.527s sys 0m0.208s to real 1m0.000s user 0m0.748s sys 0m0.029s with my selection of all font packages I could find in Fedora totalling 1200 fonts. I consider a 50x speedup fast enough (though I'd really like it if Ian would confirm that it's still fast with 3x as many fonts). :)
Wow, excellent work! As I'm currently running the GNOME 3.2 beta (or I believe it's now RC) via Ubuntu Oneiric, when should I expect to see these changes land to test them?
I suppose the next release will be GTK 3.2.0 and there will no release before. In any case, any release > 3.1.92 will have these patches in it.
Excellent. I look forward to seeing this update. Should I note significant performance increase, I will duly report back to this thread. =]
System's now upgraded to GNOME 3.2 full, I can report a SIGNIFICANT increase in the speed of loading the font picker dialog in GNOME-tweak-tool, it loads nearly instantly now. Superb work, thank you!
Kudos to Benjamin :-)