Set max thread count in first index equals half the number of logical processor.

This commit is contained in:
zhangzihao 2021-02-01 21:20:38 +08:00
parent 9d0fb57fa5
commit f5f17e13e3
1 changed files with 2 additions and 2 deletions

View File

@ -228,7 +228,7 @@ void IndexGenerator::HandlePathList(QQueue<QVector<QString>> *messageList)
// future.cancel();
// m_doc_list_path = new QList<Document>(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<QString> *messageList)
ChineseSegmentation::getInstance();
ConstructDocumentForContent *constructer;
QThreadPool pool;
// pool.setMaxThreadCount(2);
pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1);
pool.setExpiryTimeout(100);
while(!messageList->isEmpty())
{