D9824: Optimize inotify KDirWatch backend: map inotify wd to Entry

David Faure noreply at phabricator.kde.org
Fri Jan 12 08:48:42 UTC 2018


dfaure added inline comments.

INLINE COMMENTS

> kdirwatch.cpp:721
>                                     QFile::encodeName(e->path).data(), mask)) >= 0) {
> +        m_inotify_wd_to_entry[e->wd] = e;
>          if (s_verboseDebug) {

.insert(e->wd, e) is a hair faster, says Effective STL Item 24 :)

> rjvbb wrote in kdirwatch_p.h:224
> How much overhead does this give per watched item?
> 
> I mean in bytes but I'm guessing there might be a break-even point, a number of entries under which the look-up in the map is more expensive than the current implementation. That could affect applications using KDW to monitor a tiny number of files. If correct, what kind of overhead are we talking about?

Each hash node will be approx 4+8=12 bytes, and something must point to it, so another 8 bytes, 20 in total. No big deal.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D9824

To: mwolff, dfaure, rjvbb, #kdevelop
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180112/2b695f2b/attachment.html>


More information about the Kde-frameworks-devel mailing list