MW

Profiling Rocks - KDevelop CMake Support now 20x faster

I just need to get this out quickly:

We were aware that KDevelop’s CMake support was slow. Too slow actually. It was profiled months ago and after a quick look that turned up QRegExp, it was discarded in fear of having to rewrite the whole parser properly, without using QRegExp. Which btw. is still a good idea of course.

But well, today I felt like I should do some more tinkering. I mean I managed to optimize KDevelop’s Cpp support recently (parsing Boost’s huge generated template headers, like e.g. vector200.hpp is now 30% faster). I managed to make KGraphViewer usable for huge callgraphs I produce in Massif Visualizer. So how hard could it be to make KDevelop’s CMake at least /a bit/ faster, he?

Yeah well an hour later and two commits later, I managed to find and fix two bottlenecks. Both where related to QRegExp. Neither was the actual parser, instead it was the part that evaluated CMake files, esp. the STRING(...) function. So even if we’d used a proper parser generator, this would still been slow.

The first one was the typical “don’t reinvent the wheel” kinda commit which already made the CMake support two times faster for projects that used FindQt4.cmake, i.e. any Qt or KDE project. Not bad, right? Well, while I fixed that I saw that KDevelop tried to do some Regular expression replacement on the output of qmake --help, this could not been right, could it? With help of Andreas and Aleix we found the bug in the parser and that made the CMake support 10 times faster.

So yeah, CMake projects using Qt or KDE should now get opened a whopping 20 times faster in KDevelop :)

I really love KCacheGrind and Valgrind’s callgrind - again it proved to be the most awesome tool one can imagine! If you are interested in the callgrind files:

  1. without optimization
  2. first optimization
  3. second optimization

Note: with KCacheGrind from trunk you can open these compressed files transparently :)

Comments

Want to comment? Send me an email!

Comment by seb (not verified) (2010-04-02 16:08:00)

Amazing job again Will. It is always nice and important to see some kde people actually care about performance and development tools.

Comment by Milian Wolff (2010-04-02 18:14:00)

Thanks. But who is Will? :D

Comment by jospoortvliet (not verified) (2010-03-31 21:06:00)

Note: with KCacheGrind from trunk you can open these compressed files transparently

if it had a kpart (does it?) it would even just open in a tab in akregator - like textfiles do (in case of source they even show code highlighting)

KDE FTW!!!

Comment by Blackpaw (not verified) (2010-03-31 14:43:00)

Awesome, KDevelop is really shaping up. I presume you committed these, I built the latest trunk and did a clean load of rekonq, it easily seems much faster than before.

Comment by Dario (not verified) (2010-03-31 11:57:00)

You earned a virtual beer for that, thanks!

Comment by Niko (not verified) (2010-03-31 11:34:00)

Wow, great!

Keep up the good work

Comment by Mensoif (not verified) (2010-03-31 09:48:00)

That’s amazing, keep on the good work.

Published on March 31, 2010.