Monday, November 01, 2004

... ah, but the start up times!

in a responseblog, Malte S. Stretz (who's a pretty cool guy, i might add) noted that while Konsole may be more efficient in certain workloads, that there is room for improvement in places like start up time.

he's right. KDE has lots of room for improvement. we do a lot of things quite well right now, however. and we'll get more things Right(tm) with future development. but it's being able to hold both the idea that we Rock and the idea that we have room for improvement in our heads at the same time that's important.

anyways, on to Malte's numbers! he notes that `xterm -e bash -c exit` takes 0.363s while 'konsole -e bash -c exit' takes 2.148s. holy crap! over 6 times as long! ah... but there's a catch. a small one, but still a catch...

on my system, with both xterm and konsole in cache so as to remove the affects of disk i/o as much as possible, `xterm -e bash -c exit` takes ~0.165s and 'konsole -e bash -c exit' takes ~.9s, but 'kstart konsole -e bash -c exit' takes ~0.5s. the kstart hack brings konsole start up times down from being ~5.5x slower to being ~3x slower. that's much better, but more importantly, that multiplier works out to just one third of a second longer to launch konsole.

now stop for a moment and consider that: a third of a second. for all those features, for all that KDE goodness. 300 milliseconds.

let's also consider that terminals are really a Worst Case Scenario. xterm and friends don't do a lot, and they aren't very interesting. because of this they start up fast and are slim like that Olsen twin. and still KDE apps compete reasonably in this space.

this bodes very well for KDE applications in more complex venues such as word processors, web browsers and so on.

yes, we have a LOT of optimization possibilities ahead of us. yes, our software can and should be faster, including starting up. yes, we have a lot of development ahead of us to do because KDE isn't perfect yet.

we're only mostly perfect. ;-)

15 Comments:

  • (1) that pic you linked says 'Forbidden' ;(
    (2) Before I prelinked everything, KWrite took something like 3 seconds to start (after, it's more like one). Compare to Notepad under Windows, which starts *instantly*. A more comparable/advanced editor called EditPad Pro still starts up in ~half a second. MS Word 97 also starts up damn fast, well under a second, iirc (though I haven't tried in a while). The situation is similar with other KDE apps (or Linux apps in general? no idea, haven't tried GNOME).
    Not bashing or anything; KDE rocks. But the first step to fixing a problem is recognizing that it exists. And this one most definitely does.

    -Illissius

    By Anonymous, at 1:53 PM  

  • I don't clock much difference between using kstart
    or not; 1.9s without, 1.27 with. Xterm on the other hand is 0.5s. But I've just noticed that using KDE on the same machine but with Debian feels faster than using KDE with SuSE, and these are the SuSE numbers.

    By Anonymous, at 2:08 PM  

  • @Illissius

    please re-read the blog entry. i think you missed three important things:

    1) i note that KDE can and should be made faster, including start up. so i'm not sure what you're going on about.

    2) this is about konsole on X11/Unix, not kwrite and not notepad on win32. i know the similarity between konsole and kwrite or xterm and notepad can lead to confusion (he says, firmly tongue in cheek) but today's blog was about konsole. on X11. on Unix type platforms.

    3) moreover, the whole point of the blog was to show that Malte's numbers weren't as good as they could be. you demonstrate that yourself with KWrite dropping from ~3s to ~1s with prelink, which means instead of being 6 times slower to start than your win32 app it's only 2 times slower to start. and that doubling in time equates to half a second!

    in summary: i completely agree that we can and should do better in the start up category. but we don't nearly deserve the rap we have at the moment.

    you'd think we were molasses on a winter day given how people yam on about it. the way it's commonly talked about, you'd think KDE apps take dozens of seconds or even minutes to start up! that KDE requires half a gig of RAM! etc, etc...

    all i'm looking for is some accurate and factual representations out there, because KDE and the Linux desktop in general is getting hurt by the mythconceptions that continue to float about.

    By Aaron J. Seigo, at 2:35 PM  

  • @Anonymous:

    1.9 - 1.27 = 0.63
    0.63 / 1.9 = 0.33

    33% is significant from an optimization standpoint.

    it also drops the "Xterm differential" from ~4x to ~2.5x. and it means an extra 0.77s of wait.

    yep, still too long (because it isn't perfect ;) but not the drudgery that so many claim it to be.

    By Aaron J. Seigo, at 2:39 PM  

  • @aseigo: I was essentially agreeing with you. Startup times aren't only relevent for Konsole, which is why I generalized it, and KWrite was the first example I could think of. 3 seconds (with the default setup) isn't completely horrible, but it can be painful when you just want to quickly edit some text, especially compared to something like Notepad which starts instantly.
    As for prelinking... is it a viable option to do this by default? From what I remember there was something about the prelink going away if either the binary or the library linked to is changed, meaning startup times would gradually deteriorate over time... which isn't good. Or is there a better way to achieve the same effect?
    Anyways, as I said, I'm agreeing with you completely; just adding my own observations.

    -Illissius

    By Anonymous, at 3:11 PM  

  • Hi Aaron,

    to konsole: konsole has become quite bloated. It links to the huge kio lib just to have bookmarks. I never used these bookmarks. Does anybody else ?
    I measured startup time, it must be already 3 years ago on my old K6/200. Originally it was 2.7 seconds. After one week of work I got it down to 1.8 seconds. This was achieved by delaying everything what could be delayed (which resulted in not so easy to understand code).
    At least two times since then this delayed construction of stuff was broken and I fixed it again. I didn't look at it since some time now, so I don't know if it currently works. As I mentioned, it was 1.8 seconds on a K6/200, KDE 2.x.
    I already thought about writing a slim konsole, with less features (or basically without kio)

    Bye
    Alex
    neundorf at kde dot org

    By Anonymous, at 3:13 PM  

  • @Illissius

    to prelink or not to prelink is something that's up to the individual OS vendors/projects. AFAIK, a lot of the benefits from the early prelink hack has been moved into the newer glibc's and ld's so these benefits should trickle on out to the world en masse with time.

    @Alex

    yeah, i remember your work on konsole start up times and vastly appreciated it when it happened (and then happened again ;). i'm not sure if it's been broken since, i surely hope not.

    as for the bookmarks and linking in libkio for that, i agree that it was a questionable feature add. of course, if we remove it now some small army of users will rise up in arms. ;-) i'll have to blog someday about the dangers of adding features just to add features. not like that hasn't be blog'd to death, but hey.... ;-)

    By Aaron J. Seigo, at 3:20 PM  

  • Aaron, first, thanks for the coolness factor -- I hope you don't mind that I uppercased your first I :)

    I never intended my "benchmark" to be represantative, it was just something I, ummm..., hacked into a one shot Konsole I opened for that reason :P And actually, Kwrite, which Illissius mentioned, is another candidate which I use in that way.

    Whatever the kstart kluge you mentioned gave me a 33% speedup, too. What's the difference with that?

    If it doesn't hve too much drawbacks, maybe instead of me having to prefix all the commands in KDE's .desktop files, something like that should become the default? Or at least an option in KDE .desktop files to start apps like that? (Please don't ask me for code :)

    Cheers,
    Malte

    By Anonymous, at 4:44 PM  

  • I just tried, kstart doesn't change anything for me here.
    You can try kdeinit_wrapper konsole , this starts konsole vioa kdeinit (you probably already guessed). Now this is something nobody will type all the time. OTOH who starts konsole by typing konsole into a terminal ? AFAIK minicli also uses kdeinit to start kde apps.
    (maybe a bunch of aliases like
    alias Konsole = kdeinit_wrapper konsole
    wouldn't be too bad)

    Alex


    Alex

    By Anonymous, at 5:18 PM  

  • Don't we have a better place to discuss optimizations? Like, a certain mailing list? Anyway...

    The kstart vs no-kstart "benchmark" is flawed. Adding kstart to "time konsole -e bash -c exit" changes only two things:
    - makes the startup longer
    - makes 'time' measure the startup time of kstart (only) - I can even see the output from 'time' here before konsole shows up

    For Alex, about kdeinit_wrapper:
    You can do 'ln -s /opt/kde3/bin/kdeinit_wrapper konsole' somewhere, and if you have that first in your $PATH, just doing 'konsole' will launch konsole using kdeinit (the same works with kshell and kwrapper - see kdelibs/kinit/README.wrapper).

    Lubos Lunak

    By Anonymous, at 2:27 AM  

  • isnt it strange if kstart and/or kde-init can make apps startup faster, they aren't normally used? is there some dis-advantage at stake, or should the distributions do it, or???

    By Anonymous, at 6:59 AM  

  • This post has been removed by a blog administrator.

    By Anonymous, at 12:22 PM  

  • This blog is awesome! If you get a chance you may want to visit this mlm software site, it's pretty awesome too!

    By tweedledeetweedledum, at 6:22 AM  

  • Hi, you have a great blog here! I'm definitely going to bookmark you!
    I have a double opt in mlm lead site. It pretty much covers double opt in mlm lead related stuff. Check it out if you get time :-)

    By Don, at 12:48 PM  

  • Your Blog is Great! I'm definitely going to bookmark you! I have a medical billing work at home
    site. It pretty much covers medical billing work at home
    related stuff.

    Come and check it out if you get time :-)

    By Don, at 10:46 PM  

Post a Comment

<< Home