Profiling silly video

Harri Porten porten at kde.org
Sun Aug 24 16:15:26 BST 2008


Hi!

I wasn't aware of the "Silly Video" example

   http://www.hixie.ch/tests/adhoc/perf/video/001.html

until I saw Maksim's regression fix[1] from last night (i.e. make sure you 
have a current version before trying it out). I guess it can serve as a 
very good example of profiling both HTML rendering and the JS bindings - 
which I assume is why Germain was also running it.

Anyone else did look for bottle necks already? I've put the screenshot of 
a KCachegrind run of my (debug) build at 
http://www.froglogic.com/~porten/profile.png

The numbers are sorted by "Self". As so often no single function stands 
out although some CSS functions are in leading positions. After looking at 
the cause of malloc() calls I really wonder whether we should consolidate 
our strings classes a bit. Besides the KJS string class there are two in 
KHTML with a lot of QString <-> DOMString conversions taking place. Those 
could be avoid by adding more features to DOMString.

A low hanging fruite: I wondered how 9% can be made up by 
QString::sprintf() calls. Turned out that QColor::name() has a simple but 
inefficient implementation. Will report this to qt-bugs although I'm not 
sure how good the chances of an improved version are because our demand 
might be considered too special. Meanwhile I think we can simply skip it 
completely and accomplish

  	text = QColor(m_value.rgbcolor).name();

in a differenet way.

Harri.

[1] http://bugs.kde.org/show_bug.cgi?id=166099




More information about the kfm-devel mailing list