Set max thread count in first index equals half the number of logical processor.
This commit is contained in:
parent
9d0fb57fa5
commit
f5f17e13e3
|
@ -228,7 +228,7 @@ void IndexGenerator::HandlePathList(QQueue<QVector<QString>> *messageList)
|
||||||
// future.cancel();
|
// future.cancel();
|
||||||
// m_doc_list_path = new QList<Document>(docList);
|
// m_doc_list_path = new QList<Document>(docList);
|
||||||
QThreadPool pool;
|
QThreadPool pool;
|
||||||
// pool.setMaxThreadCount(1);
|
pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1);
|
||||||
pool.setExpiryTimeout(100);
|
pool.setExpiryTimeout(100);
|
||||||
ConstructDocumentForPath *constructer;
|
ConstructDocumentForPath *constructer;
|
||||||
while(!messageList->isEmpty())
|
while(!messageList->isEmpty())
|
||||||
|
@ -260,7 +260,7 @@ void IndexGenerator::HandlePathList(QQueue<QString> *messageList)
|
||||||
ChineseSegmentation::getInstance();
|
ChineseSegmentation::getInstance();
|
||||||
ConstructDocumentForContent *constructer;
|
ConstructDocumentForContent *constructer;
|
||||||
QThreadPool pool;
|
QThreadPool pool;
|
||||||
// pool.setMaxThreadCount(2);
|
pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1);
|
||||||
pool.setExpiryTimeout(100);
|
pool.setExpiryTimeout(100);
|
||||||
while(!messageList->isEmpty())
|
while(!messageList->isEmpty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue