Perf: Optimize ProjectItemDataProvider::itemCount()
ClosedPublic

Authored by kfunk on Jan 9 2017, 10:44 PM.

Details

Summary

A callgrind run showed that ProjectItemDataProvider::itemCount() is called a lot of
times when quick open is opened, but the function itself causes massive re-computation of
known values each time it is invoked.

This patches fixes this, implementing a cache for the total item count
of the data provider.

Testing: After a second callgrind run
ProjectItemDataProvider::itemCount() no longer showed up as an expensive
function.

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kfunk updated this revision to Diff 9948.Jan 9 2017, 10:44 PM
kfunk retitled this revision from to Perf: Optimize ProjectItemDataProvider::itemCount().
kfunk updated this object.
kfunk edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 9 2017, 10:44 PM
kfunk updated this object.Jan 9 2017, 10:45 PM
apol added a subscriber: apol.Jan 10 2017, 1:51 AM

Other than that, LGTM.

plugins/quickopen/projectitemquickopen.h
30

More than caching, delays, no?

apol accepted this revision.Jan 10 2017, 1:52 AM
apol added a reviewer: apol.
This revision is now accepted and ready to land.Jan 10 2017, 1:52 AM
mwolff accepted this revision.Jan 10 2017, 3:57 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

nice

This revision was automatically updated to reflect the committed changes.