dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kioexecd.cpp:36
>  
> +const int predefinedTimeout = 30000; // 30s
> +

static const int...

> kioexecd.cpp:86
> +{
> +    m_deleted_mutex.lock();
> +    m_deleted.remove(path);

Why is there a mutex at all, in this single-threaded code? This doesn't make 
sense to me.

> kioexecd.cpp:133
> +    for (auto it = m_deleted.begin(); it != m_deleted.end();) {
> +        if (it.value().msecsTo(QDateTime::currentDateTime()) >= 
> predefinedTimeout) {
> +            qCDebug(KIOEXEC) << "Going to forget" << it.key();

Move the call to currentDateTime() outside of the loop, so it happens only once.
It's much more costly than one might think (because of timezone conversion, 
which uses tzset() etc.)

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, broulik, ngraham, dfaure, elvisangelaccio
Cc: anthonyfieroni, elvisangelaccio, kde-frameworks-devel, michaelh, ngraham, 
bruns

Reply via email to