https://bugs.kde.org/show_bug.cgi?id=384880

--- Comment #8 from RJVB <rjvber...@gmail.com> ---
Either way, KDirWatch *is* that old. Most code in it was last touched during a
Jenkins commit in 2013 (transition to KF5?). Some work has been done on it
recently but still it too checks each and every entry being added against a
list of already added entries (and its contains() implementation looks like it
might not be optimised at all). Optimising this code is closer to home than
QFSW even if the main cost is clearly with QFSW.

Anyway I've been doing some tinkering. Curiously it seems that removing the
KDirWatch::WatchFiles flag from the addDir() call *increases* the time spent in
that method when the QFSW method is used (and by no small amount).

OTOH, using KDirWatch::WatchDirOnly (in eventuallyLoadDirectory()) and the
dirty instead of the created signal gives a dirwatcher that seems to work as it
should (for the toplevel folder and any folders I reload manually). It even
works on Mac.

I found an unsent email in which I intended to ask if deferring feeding the
dirwatcher to the FileManagerListJob class would be an acceptable approach.
That's the class that apparently does the actual project loading, and I'd thus
expect it to be the logical place to add individual project directories, on a
backgrond thread and with minimal event loop blocking.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to