BlogProfiling Rocks - KDevelop CMake Support now 20x faster Syndicate content

Wed, 03/31/2010 - 01:24

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 :)


Amazing job again Will. It is Fri, 04/02/2010 - 16:08 — seb (not verified)

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

Thanks. But who is Will? :D Fri, 04/02/2010 - 18:14 — Milian Wolff

Thanks. But who is Will? :D

Note: with KCacheGrind from Wed, 03/31/2010 - 21:06 — jospoortvliet (not verified)

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)


Awesome, KDevelop is really Wed, 03/31/2010 - 14:43 — Blackpaw (not verified)

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.

You earned a virtual beer for Wed, 03/31/2010 - 11:57 — Dario (not verified)

You earned a virtual beer for that, thanks!

Wow, great! Keep up the good Wed, 03/31/2010 - 11:34 — Niko (not verified)

Wow, great!

Keep up the good work

That’s amazing, keep on the Wed, 03/31/2010 - 09:48 — Mensoif (not verified)

That’s amazing, keep on the good work.

Post new comment

  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <pre>.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options