https://bugs.kde.org/show_bug.cgi?id=378227

            Bug ID: 378227
           Summary: KDialog scans all fonts directory before showing
                    dialog box making it super slow
           Product: kdialog
           Version: 1.0
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I used strace and found out kdialog scans all my fonts directory before
launching. If there are tons of fonts, it sometimes takes upto 10-15 seconds to
show up. This is on a SSD, I can only imagine how slow it would be on an HDD.

I noticed these files take up tons of stat calls:
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mdotbelow.glif",
{st_mode=S_IFREG|0644, st_size=224, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mediumshade.glif",
{st_mode=S_IFREG|0644, st_size=19674, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mhook.glif",
{st_mode=S_IFREG|0644, st_size=2098, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/minus.glif",
{st_mode=S_IFREG|0644, st_size=332, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/minusbelowcmb.glif",
{st_mode=S_IFREG|0644, st_size=427, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mlonglegturned.glif",
{st_mode=S_IFREG|0644, st_size=1709, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mturned.glif",
{st_mode=S_IFREG|0644, st_size=387, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mu.glif",
{st_mode=S_IFREG|0644, st_size=1523, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/mu.math.glif",
{st_mode=S_IFREG|0644, st_size=176, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/multiply.glif",
{st_mode=S_IFREG|0644, st_size=657, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/musicalnotedbl.glif",
{st_mode=S_IFREG|0644, st_size=1513, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/n.glif",
{st_mode=S_IFREG|0644, st_size=1199, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/n.sups.glif",
{st_mode=S_IFREG|0644, st_size=952, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nacute.glif",
{st_mode=S_IFREG|0644, st_size=218, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/naira.glif",
{st_mode=S_IFREG|0644, st_size=1250, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/napostrophe.glif",
{st_mode=S_IFREG|0644, st_size=1020, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nbspace.frac.glif",
{st_mode=S_IFREG|0644, st_size=110, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nbspace.glif",
{st_mode=S_IFREG|0644, st_size=128, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/ncaron.glif",
{st_mode=S_IFREG|0644, st_size=218, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/ncommaaccent.glif",
{st_mode=S_IFREG|0644, st_size=229, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/ndotaccent.glif",
{st_mode=S_IFREG|0644, st_size=226, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/ndotbelow.glif",
{st_mode=S_IFREG|0644, st_size=224, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/ngrave.glif",
{st_mode=S_IFREG|0644, st_size=218, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nhookleft.glif",
{st_mode=S_IFREG|0644, st_size=1551, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.cap.glif",
{st_mode=S_IFREG|0644, st_size=1516, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.dnom.glif",
{st_mode=S_IFREG|0644, st_size=1519, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.glif",
{st_mode=S_IFREG|0644, st_size=1535, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.numr.glif",
{st_mode=S_IFREG|0644, st_size=176, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.onum.glif",
{st_mode=S_IFREG|0644, st_size=1521, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.subs.glif",
{st_mode=S_IFREG|0644, st_size=1527, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nine.sups.glif",
{st_mode=S_IFREG|0644, st_size=176, ...}) = 0
stat("/usr/share/fonts/opentype/scp/Roman/ExtraLight/font.ufo/glyphs/nje.glif",
{st_mode=S_IFREG|0644, st_size=1467, ...}) = 0

This is from strace -C:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 64.26    0.004864          14       344           getdents
 32.37    0.002450           0     49834       340 stat
  0.75    0.000057           0       139           brk
  0.54    0.000041           0      1253        24 lstat
  0.45    0.000034           0      1120       888 recvmsg
  0.33    0.000025           0       852        61 open
  0.33    0.000025           0       838           fstat
  0.28    0.000021           0      1140       553 access
  0.25    0.000019           0       337           mmap
  0.22    0.000017           0       799           close
  0.21    0.000016           0       142           fcntl
---snipped---

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to