Revision df4c807...

Go back to digest for 12th February 2012

Optimization in Development Tools

Milian Wolff committed changes in [kdevplatform/1.3] project/projectmodel.cpp:

optimize icon-name finding for project file items

the above was a hotspot when loading a large project, like e.g. Qt
there my measurements showed we spent nearly ~3s (on my machine) in
ProjectFileItem::setUrl. With this patch the accumulated time goes
down to ~0.2s on my machine - quite a difference :)

note: I apply a similar optimization technique as we do already
in the language controller, with the difference that we *never*
want the "full" i.e. non-fast mimetype finding. Hence we can rely
on KMimeType::findByUrl with the fast=false flag set. Just re-using
the same KMimeType::Ptr and hence bypassing repeated internal XML
parsings yields a big performance gain. Note that the latter is apparently
greatly improved for Qt5 by David Faure.

Anyhow, as an additional optimization, we use a second cache based on
the file extension - if one exists and is short enough.

So far I cannot see any regressions but profiling shows it's a lot faster

File Changes

Modified 1 files
  • project/projectmodel.cpp
1 files changed in total