D9823: Optimize: use QMetaObject::invokeMethod with functor
Milian Wolff
noreply at phabricator.kde.org
Thu Jan 11 15:11:45 UTC 2018
mwolff created this revision.
mwolff added a reviewer: dfaure.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
mwolff requested review of this revision.
REVISION SUMMARY
When using this method with a string argument, the method would need
to be queried every time via QMetaObject::indexOfMethod. Using a
functor one can get rid of this, saving a few cycles which can
add up when handling many inotify events.
Note that the benchmark timing does not really improve significantly.
Using a profiler like perf, we do see that less cycles are consumed
though. In my measurement, this reduces the cpu cyles by about 2%.
REPOSITORY
R244 KCoreAddons
REVISION DETAIL
https://phabricator.kde.org/D9823
AFFECTED FILES
src/lib/io/kdirwatch.cpp
To: mwolff, dfaure
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180111/d65d2c80/attachment.html>
More information about the Kde-frameworks-devel
mailing list