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

List:       kde-commits
Subject:    KDE/kdebase/runtime/nepomuk/services/queryservice
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2010-11-29 9:33:51
Message-ID: 20101129093351.792BEAC8A6 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1201971 by trueg:

Reverted the result reporting in batches. It feels slower in the end and it annoys me \
way too much.

 M  +1 -13     searchrunnable.cpp  


--- trunk/KDE/kdebase/runtime/nepomuk/services/queryservice/searchrunnable.cpp \
#1201970:1201971 @@ -86,9 +86,6 @@
     time.start();
 #endif
 
-    // we push the results in batches to lower the traffic and improve the user \
                experience
-    QList<Result> resultCache;
-
     Soprano::QueryResultIterator hits = \
ResourceManager::instance()->mainModel()->executeQuery( sparql, \
Soprano::Query::QueryLanguageSparql );  while ( m_folder &&
             hits.next() ) {
@@ -96,19 +93,12 @@
 
         kDebug() << "Found result:" << result.resource().resourceUri() << \
result.score();  
-        resultCache << result;
-
-        // FIXME: does it really make sense to emit results in batches? Or do we \
then waste time that we could already use to stat local file results in the kio \
                slave?
-        static const int s_resultBatchSize = 20;
-        if( resultCache.count() >= s_resultBatchSize ) {
             lock.relock();
             if( m_folder ) {
-                m_folder->addResults( resultCache );
-                resultCache.clear();
+            m_folder->addResults( QList<Result>() << result );
             }
             lock.unlock();
         }
-    }
 
 #ifndef NDEBUG
     kDebug() << time.elapsed();
@@ -116,8 +106,6 @@
 
     lock.relock();
     if( m_folder ) {
-        if( !resultCache.isEmpty() )
-            m_folder->addResults( resultCache );
         m_folder->listingFinished();
     }
 }


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

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