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 89946 - incorrect error logic in pangoxft -> really slow startup time
incorrect error logic in pangoxft -> really slow startup time
Status: VERIFIED NOTABUG
Product: pango
Classification: Platform
Component: general
1.0.x
Other Mac OS
: Normal normal
: ---
Assigned To: Owen Taylor
Owen Taylor
Depends on:
Blocks:
 
 
Reported: 2002-08-05 18:12 UTC by jacob berkman
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
exit the loop when we've found a match (524 bytes, patch)
2002-08-05 18:13 UTC, jacob berkman
none Details | Review
test-pango.c (338 bytes, text/plain)
2002-08-05 18:22 UTC, jacob berkman
  Details
print some time output (1.08 KB, patch)
2002-08-05 19:52 UTC, jacob berkman
none Details | Review

Description jacob berkman 2002-08-05 18:12:08 UTC
with GDK_USE_XFT=1, apps would take a really long time to startup.

i think the attached patch is the right fix.

jacob@localhost:jacob$ time GDK_USE_XFT=1 ./test-pango 

real    0m4.553s
user    0m4.000s
sys     0m0.170s
jacob@localhost:jacob$ time GDK_USE_XFT=1 ./test-pango 

real    0m1.628s
user    0m1.330s
sys     0m0.110s
Comment 1 jacob berkman 2002-08-05 18:13:30 UTC
Created attachment 10273 [details] [review]
exit the loop when we've found a match
Comment 2 jacob berkman 2002-08-05 18:22:36 UTC
Created attachment 10276 [details]
test-pango.c
Comment 3 Owen Taylor 2002-08-05 18:39:25 UTC
No, the current code is right... the list *is* supposed
to have all the fonts so that we can do fallback matching.
Don't know why it is so slow for you.

Comment 4 jacob berkman 2002-08-05 19:05:57 UTC
ok.

how many fonts does fc-list give you?
Comment 5 jacob berkman 2002-08-05 19:51:55 UTC
when running test-pango with this patch i get:

Took 4.660614 seconds to check 2641 patterns (avg: 0.001765).
Comment 6 jacob berkman 2002-08-05 19:52:27 UTC
Created attachment 10279 [details] [review]
print some time output
Comment 7 Owen Taylor 2002-08-05 19:59:52 UTC
You have 2600 hundred ttf's installed? While I can't claim
that people don't install 1000-crappy-fonts CD's, it isn't
actually useful... Or, hmm, do you have fontconfig pointed
into your .pcf directories? (Normally on Linux, nothing
bad happens because the X server's pcf files are gzip'ed,
and freetype can't load gzip'ed pcf files.)

I have a patch from Keith to redo this code, but I'm not
sure it would fix your problem.
Comment 8 jacob berkman 2002-08-05 20:06:18 UTC
i have ~65 .ttf fonts installed, and just .pcf.gz (no .pcf).
Comment 9 Owen Taylor 2002-08-05 20:53:42 UTC
Can you figure out what all the patterns are then?
Comment 10 jacob berkman 2002-08-05 21:16:24 UTC
i added an FcPrintPattern() on the pattern_copy:

jacob@localhost:jacob$ ./test-pango | xargs -n 1 echo | grep -c Verdana 
658

it's a huge string - tons of duplicated family names etc (ie, 658
"Verdana" entries)

still looking at why that is happening...
Comment 11 jacob berkman 2002-08-05 21:49:50 UTC
so it turns out this was because my ~/.fonts.conf was an edited copy
of /etc/fonts/fonts.conf, and i guess it was recursively including
itself or something else strange.
Comment 12 Keith Packard 2002-08-06 00:43:38 UTC
How would you like me to fix this?  Generate an error if include files
are nested too deeply?  I could also make the font directories unique
so that multiple instances of the same names don't generate multiple
fonts in the database.  Making fonts unique would be *much* more
expensive, essentially turning an O(n) operation into O(n**2).
Comment 13 Behdad Esfahbod 2005-11-30 15:55:55 UTC
Yeah, I think making sure a directory is not added more than once is enough.
Comment 14 Behdad Esfahbod 2005-11-30 22:20:29 UTC
I submitted a patch to fontconfig list that makes sure config files are not
processed more than once.  Seems like directories are already handled correctly.