[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevplatform/5.0] project: Extend FileManagerListJob timing debug code.
From:       Milian Wolff <mail () milianw ! de>
Date:       2016-01-31 22:51:58
Message-ID: E1aQ0qc-0003JH-9R () scm ! kde ! org
[Download RAW message or body]

Git commit 6860ae125805e2c3ec47c4bed4ca0a453734cfd2 by Milian Wolff.
Committed on 31/01/2016 at 22:51.
Pushed by mwolff into branch '5.0'.

Extend FileManagerListJob timing debug code.

This adds per-job timing as well which I just needed to get more
insight as to why these list jobs tend to take a very long time
in KDevelop.

M  +13   -1    project/filemanagerlistjob.cpp
M  +2    -0    project/filemanagerlistjob.h

http://commits.kde.org/kdevplatform/6860ae125805e2c3ec47c4bed4ca0a453734cfd2

diff --git a/project/filemanagerlistjob.cpp b/project/filemanagerlistjob.cpp
index 1cf2dc9..f45d4b5 100644
--- a/project/filemanagerlistjob.cpp
+++ b/project/filemanagerlistjob.cpp
@@ -73,6 +73,10 @@ void FileManagerListJob::startNextJob()
         return;
     }
 
+#ifdef TIME_IMPORT_JOB
+    m_subTimer.start();
+#endif
+
     m_item = m_listQueue.dequeue();
     KIO::ListJob* job = KIO::listDir( m_item->path().toUrl(), KIO::HideProgressInfo );
     job->setParentJob( this );
@@ -87,6 +91,14 @@ void FileManagerListJob::slotResult(KJob* job)
         return;
     }
 
+#ifdef TIME_IMPORT_JOB
+    {
+        auto waited = m_subTimer.elapsed();
+        m_subWaited += waited;
+        qDebug() << "TIME FOR SUB JOB:" << waited << m_subWaited;
+    }
+#endif
+
     emit entries(this, m_item, entryList);
     entryList.clear();
 
@@ -98,7 +110,7 @@ void FileManagerListJob::slotResult(KJob* job)
         emitResult();
 
 #ifdef TIME_IMPORT_JOB
-        qCDebug(FILEMANAGER) << "TIME FOR LISTJOB:" << m_timer.elapsed();
+        qDebug() << "TIME FOR LISTJOB:" << m_timer.elapsed();
 #endif
     } else {
         emit nextJob();
diff --git a/project/filemanagerlistjob.h b/project/filemanagerlistjob.h
index 279f637..fbbe986 100644
--- a/project/filemanagerlistjob.h
+++ b/project/filemanagerlistjob.h
@@ -68,6 +68,8 @@ private:
 
 #ifdef TIME_IMPORT_JOB
     QElapsedTimer m_timer;
+    QElapsedTimer m_subTimer;
+    qint64 m_subWaited = 0;
 #endif
 };
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic