diff --git a/libsearch/index/index-generator.cpp b/libsearch/index/index-generator.cpp index dba2f3b..5924c0d 100644 --- a/libsearch/index/index-generator.cpp +++ b/libsearch/index/index-generator.cpp @@ -228,7 +228,7 @@ void IndexGenerator::HandlePathList(QQueue> *messageList) // future.cancel(); // m_doc_list_path = new QList(docList); QThreadPool pool; -// pool.setMaxThreadCount(1); + pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1); pool.setExpiryTimeout(100); ConstructDocumentForPath *constructer; while(!messageList->isEmpty()) @@ -260,7 +260,7 @@ void IndexGenerator::HandlePathList(QQueue *messageList) ChineseSegmentation::getInstance(); ConstructDocumentForContent *constructer; QThreadPool pool; -// pool.setMaxThreadCount(2); + pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1); pool.setExpiryTimeout(100); while(!messageList->isEmpty()) {