Revision f25abde...

Go back to digest for 11th May 2014

Optimization in Development Tools

Milian Wolff committed changes in [kdevplatform] /:

Optimize PluginController::pluginForExtension for common case.

When we look up an already loaded plugin by its extension, we can
bypass the costly KPluginInfo::fromServices call by just checking
the extension of the loaded plugins directly.

The benchmark shows that this is much faster:

Now:
0.00080 msecs per iteration (total: 53, iterations: 65536)
Before:
1.1 msecs per iteration (total: 72, iterations: 64)

This is especially noticeable with the new IDefinesAndIncludesManager
plugin, which will be queried for every file we parse. In kdev-clang,
the call to pluginForExtension was a bottleneck when we reload an
already parsed session with many files.

File Changes

Modified 3 files
  •   shell/plugincontroller.cpp
  •   shell/tests/plugincontrollertest.cpp
  •   shell/tests/plugincontrollertest.h
3 files changed in total