[Fontconfig-bugs] [Bug 94427] New: code from git is slow compared 2.11

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 7 16:04:25 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=94427

            Bug ID: 94427
           Summary: code from git is slow compared 2.11
           Product: fontconfig
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: library
          Assignee: fontconfig-bugs at lists.freedesktop.org
          Reporter: kokoko3k at gmail.com
        QA Contact: freedesktop at behdad.org

Created attachment 122139
  --> https://bugs.freedesktop.org/attachment.cgi?id=122139&action=edit
grep ^stat64 /tmp/out_fast|grep font >/tmp/stat_fast.txt

On a not so powerfull ATOM 330 running at 2ghz, i've noticed that even the
simplest gui application using qt4 or gtk2 toolkits (didn't test other) suffers
from a high delay when starting up.
On this particular machine, i measured it to be around one second.


The following script /tmp/startuptime.sh 
measures the application startup time of the program "gtk-demo"
#---------------------------------------------------------------------
#!/bin/bash
ln -s /usr/bin/sleep /tmp/mysleep &>/dev/null
time /tmp/mysleep 999 &

gtk-demo &
while true ; do
    wmctrl -l|grep 'GTK+ Code Demos' &>/tmp/out
    if [ $? -eq 0 ] ; then
        killall mysleep &>/tmp/out
        break
    fi
    sleep 0.05
done
killall gtk-demo &>/tmp/out
unlink /tmp/mysleep
#---------------------------------------------------------------------



Test startup time with fontconfig and freetype from git:
#---------------------------------------------------------------------
$ /tmp/startuptime.sh
/tmp/startuptime.sh: riga 3:  4321 Terminato               /tmp/mysleep 999

real    0m1.149s
user    0m0.000s
sys     0m0.000s
#---------------------------------------------------------------------



Now with standard fontconfig and freetype:
#---------------------------------------------------------------------
$ /tmp/startuptime.sh
/tmp/startuptime.sh: riga 3:  4508 Terminato               /tmp/mysleep 999

real    0m0.325s
user    0m0.000s
sys     0m0.000s
#---------------------------------------------------------------------



If i isolate just use fontconfig from git, and freetype stable:
#---------------------------------------------------------------------
$ pacman -Q|grep 'fontconfig\|freetype2'
fontconfig 2.11.1-2
freetype2-infinality-ultimate 2.6.2-4

$ /tmp/startuptime.sh
/tmp/startuptime.sh: riga 3:  5692 Terminato               /tmp/mysleep 999

real    0m0.386s
user    0m0.000s
sys     0m0.000s
#---------------------------------------------------------------------




So it seems fontconfig is doing a lot of work with the ultimate patches.
This happens with regular user account, never-used user accounts and the root
account too.
I've already tried to rebuild the font cache with fc-cache -f and ran it with
root and regular user, without success...

i used strace to debug the issue (strace -f gtk-demo)
and created two files: out_slow and out_fast:

$ grep ^stat64 /tmp/out_slow|grep font|wc -l
4600

$ grep ^stat64 /tmp/out_fast|grep font|wc -l
47

In out_slow, you see, it seems to walk across all of the fonts and more:

grep ^stat64 /tmp/out_fast|grep font >/tmp/stat_fast.txt
http://pastebin.com/vBLXakzT

grep ^stat64 /tmp/out_slow|grep font >/tmp/stat_slow.txt
http://pastebin.com/f8KGrFGr

complete strace fast
http://pastebin.com/60RsQpy2

complete strace slow (had to split these because they were too big)
http://pastebin.com/fbXDFN2B
http://pastebin.com/We6SxwN0

I cant undesrtand if this is a bug or just the expected behaviour.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20160307/ad52ea62/attachment.html>


More information about the Fontconfig-bugs mailing list