After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 658995 - Font Picker Dialog to change application fonts in gnome-tweak-tool takes ages to load
Font Picker Dialog to change application fonts in gnome-tweak-tool takes ages...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-09-13 22:26 UTC by Ian Hex
Modified: 2011-09-27 09:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ian Hex 2011-09-13 22:26:31 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?
Comment 1 Bastien Nocera 2011-09-13 22:33:10 UTC
That's nice, but nothing whatsoever to do with gnome-control-center.
Comment 2 Christian Persch 2011-09-13 22:36:42 UTC
-> gtk+
Comment 3 Ian Hex 2011-09-13 22:38:04 UTC
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.
Comment 4 Matthias Clasen 2011-09-13 23:15:59 UTC
Out of interest, how many fonts do you have ? 

fc-list | wc -l

will tell you
Comment 5 Ian Hex 2011-09-13 23:21:36 UTC
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.
Comment 6 Andreas Nilsson 2011-09-13 23:37:04 UTC
(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.
Comment 7 Alberto Ruiz 2011-09-14 00:39:35 UTC
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.
Comment 8 Matthias Clasen 2011-09-14 16:35:18 UTC
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.
Comment 9 Benjamin Otte (Company) 2011-09-22 22:12:14 UTC
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).

:)
Comment 10 Ian Hex 2011-09-22 22:26:47 UTC
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?
Comment 11 Benjamin Otte (Company) 2011-09-22 22:53:57 UTC
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.
Comment 12 Ian Hex 2011-09-22 23:24:08 UTC
Excellent. I look forward to seeing this update. Should I note significant performance increase, I will duly report back to this thread. =]
Comment 13 Ian Hex 2011-09-27 07:03:53 UTC
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!
Comment 14 Alberto Ruiz 2011-09-27 09:19:34 UTC
Kudos to Benjamin :-)