[kdialog] [Bug 378227] KDialog scans all fonts directory before showing dialog box making it super slow

2017-06-13 Thread Deepak Mittal
https://bugs.kde.org/show_bug.cgi?id=378227

--- Comment #8 from Deepak Mittal <dpac.mitt...@gmail.com> ---
On further investigation of strace output, and doing some grepping and
filtering I found out the stat calls were made because of .glif files in
/usr/share/fonts directory. All of these files were basically sources of
source-code-pro font (https://github.com/adobe-fonts/source-code-pro). I
deleted the entire directory of that font and that has fixed the problem. I'll
file this bug with them and recommend them to not store source glyph files in
the /usr/share/fonts.

You can close this bug. Thankyou!

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

[kdialog] [Bug 378227] KDialog scans all fonts directory before showing dialog box making it super slow

2017-06-13 Thread Deepak Mittal
https://bugs.kde.org/show_bug.cgi?id=378227

--- Comment #7 from Deepak Mittal <dpac.mitt...@gmail.com> ---
This somehow looks similar to this bug is also affecting inkscape and GIMP -
https://bugs.launchpad.net/ubuntu/+source/fontconfig/+bug/1614870

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

[kdialog] [Bug 378227] KDialog scans all fonts directory before showing dialog box making it super slow

2017-06-12 Thread Deepak Mittal
https://bugs.kde.org/show_bug.cgi?id=378227

--- Comment #6 from Deepak Mittal <dpac.mitt...@gmail.com> ---
`sudo fc-cache -sf` didn't help. It's still making 55k stat calls in the
/usr/share/fonts directory.

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

[kdialog] [Bug 378227] KDialog scans all fonts directory before showing dialog box making it super slow

2017-06-10 Thread Deepak Mittal
https://bugs.kde.org/show_bug.cgi?id=378227

--- Comment #4 from Deepak Mittal <dpac.mitt...@gmail.com> ---
Someone else having the same issue here:
https://forums.opensuse.org/showthread.php/519936-Installing-new-fonts-in-Plasma-5-left-me-with-a-very-slow-system

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

[kdialog] [Bug 378227] KDialog scans all fonts directory before showing dialog box making it super slow

2017-06-10 Thread Deepak Mittal
https://bugs.kde.org/show_bug.cgi?id=378227

--- Comment #3 from Deepak Mittal <dpac.mitt...@gmail.com> ---
Also see this:
grep 'usr/share/fonts' /tmp/dolphin | grep '^stat' | wc -l
47570

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

[kdialog] [Bug 378227] KDialog scans all fonts directory before showing dialog box making it super slow

2017-06-10 Thread Deepak Mittal
https://bugs.kde.org/show_bug.cgi?id=378227

--- Comment #2 from Deepak Mittal <dpac.mitt...@gmail.com> ---
Yes pretty sure. This doesn't just happen on dialog boxes, so you may change
the "product" for this bug. This happens with every KDE application. I thought
dolphin and gwenview were generally slow, but when I moved bulk of my fonts
outside of /usr/share/fonts, everything became snappy. 

Every KDE application is parsing the fonts directory, which is making the
system unusably slow.

This is first few lines from strace -C dolphin:
% time seconds  usecs/call callserrors syscall
-- --- --- - - 
 55.310.000521   1   850   getdents
 17.520.000165   0 55772  5920 stat
  7.110.67   0 24605   127 lstat
  5.200.49   0 11790   read
  4.460.42   0  6217   close
  3.930.37   0  7943  1735 open
  3.610.34   0  6343  1654 readlinkat
  1.060.10   0 11007   fstat
  0.850.08   0  3742   359 access
  0.530.05   0  2277   getrandom
  0.420.04   0  1277   lseek
  0.000.00   0  1299   write
  0.000.00   0   802   poll
  0.000.00   0   597   mmap
  0.000.00   0   358   mprotect
  0.000.00   0   111   munmap
  0.000.00   067   brk
  0.000.00   010   rt_sigaction
  0.000.00   0 2   rt_sigprocmask
  0.000.00   054   ioctl
  0.000.00   0   453   writev
  0.000.00   015   select

Bulk of the stat calls are because of the fonts in /usr/share/fonts.

I saved the strace output in /tmp/dolphin and then ran:
grep 'usr/share/fonts' /tmp/dolphin | wc -l
   
⏎
47834

Clearly it's a big issue and it needs to be fixed.

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

[kdialog] [Bug 378227] New: KDialog scans all fonts directory before showing dialog box making it super slow

2017-03-29 Thread Deepak Mittal
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: br...@frogmouth.net
  Reporter: dpac.mitt...@gmail.com
  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,