froglogic / All / KJS Speedups

KJS Speedups

Best code is written with bad weather outside. This was proven by Maks recent work on KDE’s JavaScript engine at least. While cold and snow were plaguing North America Maks developed some nice and effective optimizations that were merged into trunk last night.

Now what was this about? The easy but slow dynamic variable lookup of KDE 3 is now replaced by a static lookup where the symbol can be bound to a local variable. On the other hand, local variables are skipped if a variable is known not to be part of the set. Due to the dynamic nature of JavaScript this approach cannot be used in all cases but wherever it applies the speedup is very noticeable. Two performance test cases supplied by Richard Moore and the iBench JavaScript test finished in 13% to 39% less time than before. Quite a bit for a single patch!

If one considers the sum of all the latests improvements done by KHTML hackers from and outside of Konqueror will perform significantly better in KDE 4. iBench and Ian Hixie’s JavaScript and DOM performance tests show a speedup factors of 2, 3 and sometimes even higher! This leads to a clear outperforming of Firefox 2.0 in some HTML test cases.

Above results will not apply 1:1 to every page. Some bottlenecks are definitely still left but will be addressed for KDE 4.0 or later releases.



Thanks for all the work. It is very much appreciated, and we need speed in kjs for application scripting e.g. KatePart 🙂

This is really cool to hear! 13-39% improvements! 🙂

I also read something at some Safari blog they’re improving the load that timers cause in AJAX pages. It was something about synchronizing the timers, and changing setTimeout( .., 0 ) to setTimeout( .., 5 ) internally.

A “good” page to stress-test Konqueror is It really slows down Konqueror, Firefox and Safari. Especially when you’re browsing profiles in tabs, or friend-lists of contacts. Firefox feels to perform better at that site.

p.s. your capcha is unreadable… 🙁

With unreadable I ment I had to refresh the page 5 times before it was something I could properly type over. Other attempts resulted in errors. The biggest problem are characters which become distorted by the wave effect. An 6, 8 and B become really similar.

Will konqueror get the session-saving feature that firefox has ? That would be very usefull,since Konq happens to crash sometimes.

Its great to hear that KHTML+friends aren’t being left out with all the improvements going into KDE for 4.0!


If you enable the ‘crash monitor’ extension (Settings -> Configure Extensions -> Tools tab), you can simply go to Tools -> Crashes and restore what you had open when Konqueror crashed. Konqueror already supports sessions, though you can’t manually save a session for just Konqueror (it supports the desktop wide sessions, though it should be possible to refactor the desktop session code in Konqueror to be able to be manually called to have something similar to Opera’s sessions (and I guess whatever Firefox has, though I don’t use it so not sure how its version works)).

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap