[KimDaBa] Startup performance issue

Robert L Krawitz rlk at alum.mit.edu
Tue Dec 14 17:33:48 GMT 2004


So startup performance, even without scanning for new images, is still
a problem in the 12/07 snapshot.  Here are snippets from strace output
for a second run of kimdaba (to get everything in core):

T=0.0     Program start:
    19543 12:09:24.349664 execve("/opt/kde3/bin/kimdaba", ["kimdaba"], [/* 93 vars */]) = 0

T=0.55    Connect to X server:
    19543 12:09:24.893348 read(4, "\0\0\0\4\201\224\267\273\0\0010\0\22MIT-MAGIC-COOKIE-1\0\20^\242\272\346Y\374\203\316\375\3118\240\206\263\224\17\1\0\0\nrlk-mobile\0\0010\0\22MIT-MAGIC-COOKIE-1\0\20^\242\272\346Y\374\203\316\375\3118\240\206\263\224\17\0\0\0\4\201\224\267\245\0"..., 4096) = 807

T=1.86    Load last KDE/QT library:
    19543 12:09:26.211447 access("/usr/lib/qt3/plugins/imageformats/libqmng.so", F_OK) = 0

T=2.48    Open index.xml (3137191 bytes, ~6200 images):
    19543 12:09:26.829125 open("/home/rlk/images/index.xml", O_RDONLY|O_LARGEFILE) = 11

T=4.84    Finish reading index.xml:
    19543 12:09:29.180697 close(11)         = 0

T=4.84    Stat first image:
    19543 12:09:29.183368 access("/home/rlk/images/108-0866_IMG.JPG", F_OK) = 0

T=6.71    Stat last image:
    19543 12:09:31.062250 access("/home/rlk/images/scans/jpeg0092.jpg", F_OK) = 0

T=7.93    Open icons and other config files:
    19543 12:09:32.283578 open("/home/rlk/.icons/crystalwhite/cursors/ibeam", O_RDONLY) = -1 ENOENT (No such file or directory)

T=8.56    Finish opening icons:
    19543 12:09:32.912478 close(11)         = 0

T=8.81    Load plugins:
    19543 12:09:33.151794 stat64("/home/rlk/.kde/share/config/", {st_mode=S_IFDIR|0700, st_size=7936, ...}) = 0

T=9.10    Finish loading plugins:
    19543 12:09:33.447483 readlink("/proc/self/exe", "/opt/kde3/bin/kimdaba", 4096) = 21

T=9.18    Load more icons:
    19543 12:09:33.523758 access("/home/rlk/.kde/share/icons/crystal/", R_OK) = -1 ENOENT (No such file or directory)

T=9.69    Finish loading/scanning icons:
    19543 12:09:34.038141 access("/opt/kde3/share/pixmaps", F_OK) = -1 ENOENT (No such file or directory)

T=11.40   Load more messages:
    19543 12:09:35.753623 access("/opt/kde3/share/locale/en_US/LC_MESSAGES/kio.mo", R_OK) = -1 ENOENT (No such file or directory)

T=11.48    Exit program:
    19550 12:09:35.832464 <... futex resumed> ) = -1 EINTR (Interrupted system call)

I've added relative times at the start of each line.  Out of
approximately 11 seconds of startup time, loading the index.xml file
takes about 2.35 seconds and stat'ing the images (when they're already
in cache on my machine, which is running ReiserFS on a 1 GHz
processor) takes about 1.85 seconds, so about 4.2 seconds are variable
time (scales with the number of images) and the rest is constant (how
much of this is KimDaBa and how much is base KDE?).

Is it really necessary to stat all of the images at startup, or could
this be deferred until needed?



More information about the Kphotoalbum mailing list