Phil Race
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
Alan Coopersmith wrote:> Stefaan A Eeckels wrote: > >> Hi List, >> >> I''ve just subscribed, please direct me to the answer >> if what I''m about to ask is the FAQ of the century :-). >> >> Comparing Sun''s Gnome 2.0 and the Blastwave build of >> Gnome 2.6 (on Solaris/SPARC), I''ve noticed that the >> 2.6 applications have an incredibly long start-up time >> (even on a Blade 2000 2x900cu, which while not the >> fastest machine on earth, is certainly no slouch). A bit of trussing >> reveals that even the most trivial >> of programs performs a full scan of all the available >> font files on the system. > > > Run fc-cache as root first to build the font caches so the > applications don''t have to do this. The fontconfig provided > by Sun in Solaris will do this for you, but I don''t know if > blastwave''s will. > >Alan is right. This makes a huge difference, although its still an issue to a degree because Solaris has way more fonts than any Linux distro I''ve ever seen. /etc/fonts/fonts.conf on a RH 9 install just has <dir>/usr/share/fonts</dir> <dir>/usr/X11R6/lib/X11/fonts/Type1</dir> <dir>/usr/X11R6/lib/X11/fonts/OTF</dir> <dir>~/.fonts</dir> whereas on Solaris 10 with gnome 2.6 the same file lists 48 directories! And many of those have a significant number of fonts and quite large fonts.dir files. Imagine trawling through that ever time you start an app. If you build the cache it doesn''t need to do so remotely so much work, but it still trawls the directories to check the cache files although I''m not 100% sure of the precise difference. And I doubt you have exactly this in the blastwave build but you get the idea. So there is something of a scaleability problem with fontconfig and there was some recent discussion on this list on ignoring BDF files and using enums instead of strcmp which long term could mitigate this, but I doubt its that easy right now. You could look at your fonts.conf (and perhaps local.conf) and decide if you really need all of those, but be careful unless you REALLY understand what you are doing. -phil.
Alan Coopersmith
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
Phil Race wrote:> I don''t know exactly what version of fontconfig is in gnome 2.6fontconfig is used by GNOME, but isn''t part of it per se. On Solaris 10, we currently ship fontconfig 2.2.3 (plus some patches from our L10N teams - at least some of which are in the 2.2.9x series in CVS, but I haven''t checked on all of them). Last I checked, that was the latest stable release to come out. -- -Alan Coopersmith- alan.coopersmith@sun.com Sun Microsystems, Inc. - X Window System Engineering
Phil Race
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
Hi Keith, > There was a bug in some older versions of fontconfig which would not > correctly update the per-user cache file in all circumstances. Interesting. I have a follow-up question of sorts relating to what goes into the per-user cache when there is no per-directory cache. At one point I was under the impression that you''d get something equivalent but now I''m not so sure. As a data point with the caches built as root a small test program which calls : pattern = FcPatternBuild(NULL, FC_OUTLINE, FcTypeBool, FcTrue,(char*)0); objset = FcObjectSetBuild(FC_FILE, 0); fontSet = FcFontList (0, pattern, objset); executes these 3 lines in approx 0.3 seconds on a fairly dated system but which is running Solaris 10 with Gnome 2.6. That''s more than you''d like but that''s just for comparison with the results below. The same program with no root built cache has to build the user cache and takes 227 seconds (almost 4 minutes!) I get a 587Kbyte user cache file at the end Executing that program again, with this up to date user cache still takes 195 seconds. So there''s apparently still a lot of work that needs to be done that''s not cached. I don''t know exactly what version of fontconfig is in gnome 2.6 but does that qualify as one of the older fontconfigs that exhibited the problem you mentioned? Or is this query just doing something that can never be satisfied by a per-user cache. -phil. Keith Packard wrote:> Around 12 o''clock on Oct 20, Stefaan A Eeckels wrote: > > >>A bit of trussing reveals that even the most trivial >>of programs performs a full scan of all the available >>font files on the system. > > > There was a bug in some older versions of fontconfig which would not > correctly update the per-user cache file in all circumstances. You may be > hitting that here. To work around it, make sure your per-directory cache > files are all up-to-date by running fc-cache > > When this is working, fontconfig should check only the timestamps on the > directories themselves, and not every font file. > > -keith > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > fontconfig mailing list > fontconfig@freedesktop.org > http://freedesktop.org/mailman/listinfo/fontconfig
Stefaan A Eeckels
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
On Wed, 20 Oct 2004 07:11:07 -0700 Alan Coopersmith <Alan.Coopersmith@Sun.COM> wrote:> Stefaan A Eeckels wrote:> > A bit of trussing reveals that even the most trivial > > of programs performs a full scan of all the available > > font files on the system. > > Run fc-cache as root first to build the font caches so the > applications don''t have to do this. The fontconfig provided > by Sun in Solaris will do this for you, but I don''t know if > blastwave''s will.Obviously not - running fc-cache made a tremendous difference and made Blastwave''s Gnome significantly faster. Thanks a lot! -- Stefaan -- "What is stated clearly conceives easily." -- Inspired sales droid
Keith Packard
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
Around 12 o''clock on Oct 20, Stefaan A Eeckels wrote:> A bit of trussing reveals that even the most trivial > of programs performs a full scan of all the available > font files on the system.There was a bug in some older versions of fontconfig which would not correctly update the per-user cache file in all circumstances. You may be hitting that here. To work around it, make sure your per-directory cache files are all up-to-date by running fc-cache When this is working, fontconfig should check only the timestamps on the directories themselves, and not every font file. -keith -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 228 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20041020/7e0a7259/attachment.pgp
Alan Coopersmith
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
Stefaan A Eeckels wrote:> Hi List, > > I''ve just subscribed, please direct me to the answer > if what I''m about to ask is the FAQ of the century :-). > > Comparing Sun''s Gnome 2.0 and the Blastwave build of > Gnome 2.6 (on Solaris/SPARC), I''ve noticed that the > 2.6 applications have an incredibly long start-up time > (even on a Blade 2000 2x900cu, which while not the > fastest machine on earth, is certainly no slouch). > A bit of trussing reveals that even the most trivial > of programs performs a full scan of all the available > font files on the system.Run fc-cache as root first to build the font caches so the applications don''t have to do this. The fontconfig provided by Sun in Solaris will do this for you, but I don''t know if blastwave''s will. -- -Alan Coopersmith- alan.coopersmith@sun.com Sun Microsystems, Inc. - X Window System Engineering
Stefaan A Eeckels
2005-Nov-21 08:51 UTC
[Fontconfig] Slow startup of trivial GNOME 2.6 applications
Hi List, I''ve just subscribed, please direct me to the answer if what I''m about to ask is the FAQ of the century :-). Comparing Sun''s Gnome 2.0 and the Blastwave build of Gnome 2.6 (on Solaris/SPARC), I''ve noticed that the 2.6 applications have an incredibly long start-up time (even on a Blade 2000 2x900cu, which while not the fastest machine on earth, is certainly no slouch). A bit of trussing reveals that even the most trivial of programs performs a full scan of all the available font files on the system. Is this the normal behaviour for fontconfig, or a coding error in Gnome? Surely, trivial applications such as a calculator, or the utility to add a link to a menu, should have the ability to access the couple of system fonts they use without scanning all font directories. Thanks and kind regards, -- Stefaan -- "What is stated clearly conceives easily." -- Inspired sales droid