MAY
7
2005

Psssst.... KDE konsole is more efficient than xterm

Sometimes you learn surprising things while you drive a car.

Last time this happened was on Thursday evening. SambaXP conference had ended in Goettingen, and I gave Tridge a lift to the Frankfurt Airport. For me it was only a very little detour on my way to Stuttgart. Tridge had a 30 hour journey back home to Australia in front of him (21 hrs of pure flight time).

During the 2-hour ride we chatted about various things, mostly technical in nature. Things covered were Samba4, its extensive usage of ldb (embedded LDAP-like database) to make it a full Active Directory domain controller, and various other topics. Tridge is a very patient and friendly person when it comes to explaining complex technical questions to a non-coder like myself. At one time we happened to touch on the question of performance in X applications. I mentioned how well konsole worked as a replacement of multiple xterms, when you use its tab feature.

Now Tridge is a KDE user, but he was sitting on the co-driver seat and looking at his notebook screen with some opened xterms running on his KDE desktop. He told me that he used xterms because he knew all their features so well, since many years. He didnt seem to like "bloated GUIs" while using a terminal. And it was important to him to use the screen estate taken by scrollbars for more display room and instead just hit [CTRL]+[PgUp] or [CTRL]+[PgDown] to scroll back and forth. OK, no big deal. Konsole can do both, switch off scrollbars and use these very shortcuts for scrolling. Moreover, it can bind its shortcuts to almost any key combo you come up with, just as you please. Tridge started konsole to look at it for the first time since long ago. He discovered konsole's "fullscreen mode" which he seemed to like a lot.

Most important to him is that scrolling does happen very efficiently, since he uses it a lot when coding or reading mail. Being the hacker he is, he applied two very simple tests to verify how much he'd loose when he switched from xterm to konsole: measure the time to run an ls -lR in a large source directory with many subdirs, and measure time for a cat /usr/dict/words.

I had never run such a test. All I was aware of were Aaron's memory usage benchmarklets (which had been the basis for my "You can efficiently replace multiple xterms with one tabbed console window"-argument towards Tridge).

So we were both very surprised. to see konsole not only being close to xterm's performance, but being more than double as efficient! Tridge is now considering to switch from xterm to konsole, probably after giving it a day or two of "probationary period".

Today I remembered that little episode, but wasn't sure any more about the figures. So I repeated the experiments. The glorious results are here:


+-----------------------------------------------------------------------------------------------+
|                                 konsole vs. xterm performance                                 |
+-----------------------------------------------+-----------------------------------------------+
|   konsole                                     |    xterm                                      |
+-----------------------------------------------+-----------------------------------------------+
| kurt@p9004:~> time cat /usr/dict/de/all.words | kurt@p9004:~> time cat /usr/dict/de/all.words |
| Aachen                                        | Aachen                                        |
| (....)                                        | (....)                                        |
| zzgl                                          | zzgl                                          |
|                                               |                                               |
| real 0m5.481s                                 | real 0m15.527s                                |
| user 0m0.005s                                 | user 0m0.005s                                 |
| sys  0m0.128s                                 | sys  0m0.124s                                 |
+-----------------------------------------------+-----------------------------------------------+
| kurt@p9004:~/SVNstuff/samba> time ls -lR .    | kurt@p9004:~/SVNstuff/samba> time ls -lR .    |
| (....)                                        | (....)                                        |
|                                               |                                               |
| real 0m1.441s                                 | real 0m4.275s                                 |
| user 0m0.123s                                 | user 0m0.309s                                 |
| sys  0m0.156s                                 | sys  0m0.196s                                 |
+-----------------------------------------------+-----------------------------------------------+



Are you also, like me, curious about how other terminal emulators work as compared to xterm? Well, I did a short showdown of xterm vs. gnome-terminal too. The good news to our Gnome-friends is: gnome-terminal also beats xterm! Look at these figures:


+-----------------------------------------------------------------------------------------------+
|                             gnome-terminal vs. xterm performance                              |
+-----------------------------------------------+-----------------------------------------------+
|    gnome-terminal                             |    xterm                                      |
+-----------------------------------------------+-----------------------------------------------+
| kurt@p9004:~> time cat /usr/dict/de/all.words | kurt@p9004:~> time cat /usr/dict/de/all.words |
| Aachen                                        | Aachen                                        |
| (....)                                        | (....)                                        |
| zzgl                                          | zzgl                                          |
|                                               |                                               |
| real 0m14.092s                                | real 0m15.527s                                |
| user 0m0.005s                                 | user 0m0.005s                                 |
| sys  0m0.132s                                 | sys  0m0.124s                                 |
+-----------------------------------------------+-----------------------------------------------+
| kurt@p9004:~/SVNstuff/samba> time ls -lR .    | kurt@p9004:~/SVNstuff/samba> time ls -lR .    |
| (....)                                        | (....)                                        |
|                                               |                                               |
| real 0m3.409s                                 | real 0m4.275s                                 |
| user 0m0.136s                                 | user 0m0.309s                                 |
| sys  0m0.152s                                 | sys  0m0.196s                                 |
+-----------------------------------------------+-----------------------------------------------+



Please don't take these results too seriously. Do not regard them as anything close to a scientific benchmark. I bet you could tweak them in many ways, depending for instance on the font the various terminals use.

Just take them as what they were to me: the result of my default workstation environment (KDE HEAD from latest CVS, self-compiled with --enable-debug) and Gnome (with gnome-terminal 2.8.0 as installed on an apt4rpm-updated SUSE-9.1). And a reason to be proud of KDE, that we can confidently advertise even to people who are looking for the highest performance they can get.

Comments

I'm using konsole all days, and this is a thing that I'm supposing.

Now I can prove, thanks!


By Luis at Sat, 05/07/2005 - 20:04

It should be noted, that this really depends on the font used in konsole. With anti aliased fonts konsole is significantly slower than without. That said, with the same fonts konsole is definitely faster than xterm.


By Michael Olbrich at Sat, 05/07/2005 - 22:32

Konsole and Gnome-Terminal are the only terminals that support scrolling back while something is running in the terminal. Every other terminal I've used (i.e. xterm, aterm, rxvt, and Eterm) can only scroll back if nothing besides the shell is running in the terminal.


By jgp at Sun, 05/08/2005 - 00:54

I have benchmarked AA konsole vs. xterm. Also, the font I use in Konsole is perhaps two times bigger that that of xterm, although I'm not sure whether it's better or worse for konsole. Anyway, here are the results:

  • konsole:
    $ time find /usr/src/linux/
    (...)
    
    real    0m46.742s
    user    0m0.956s
    sys     0m1.758s
    
  • xterm:
    $ time find /usr/src/linux/
    (...)
    
    real    0m31.172s
    user    0m0.315s
    sys     0m0.496s
    

So, not that much of a difference with AA.


By RafaƂ Rzepecki at Sun, 05/08/2005 - 07:25

Just by seeing how the text scroll on the 3 of them you can tell, but numbers speak:

xterm:
real 0m1.958s
user 0m0.000s
sys 0m0.057s

konsole:
real 0m1.154s
user 0m0.000s
sys 0m0.062s

aterm:
real 0m0.475s
user 0m0.001s
sys 0m0.043s

And also I like Aterm's default font


By aua at Sun, 05/08/2005 - 12:10