Revision 0df2338...

Go back to digest for 4th November 2012

Optimization in Development Tools

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

Optimize: Do lazy-loaded icon name lookup for project files.

This greatly improves the performance when loading big projects.
Where before we updated the icon as soon as the file was created,
i.e. its URL being set, we now only query for a proper icon when
we are asked for it in ProjectFileItem::iconName.

Since the icon name lookup is quite expensive (potential mimetype
lookup, mutex, ...) this saves a lot of work! Trying it out on the
project model performance test app, I am happy to report a drastic
performance increase of factor ~2.5:

Before patch:
init core 286
create model 0
init model 2179
set model 0
addBigTree 2098
addBigTree 2113

After patch:
init core 276
create model 0
init model 816
set model 0
addBigTree 705
addBigTree 735

This is also usually the case in a real KDevelop session, as you usually don't
have the full project tree expanded. We will now load the icons only for
visible files.

File Changes

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