Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra thread for filter index to improve performance. #589

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/dltfileindexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
// get silent mode
bool silentMode = !QDltOptManager::getInstance()->issilentMode();

bool hasPlugins = (activeDecoderPlugins.size() + activeViewerPlugins.size()) > 0;
bool hasFilters = filterList.filters.size() > 0;
//bool hasPlugins = (activeDecoderPlugins.size() + activeViewerPlugins.size()) > 0;
//bool hasFilters = filterList.filters.size() > 0;

bool useIndexerThread = hasPlugins || hasFilters;
//bool useIndexerThread = hasPlugins || hasFilters;

DltFileIndexerThread indexerThread
(
Expand All @@ -461,10 +461,10 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
silentMode
);

if(useIndexerThread)
/*if(useIndexerThread)
{
indexerThread.start(); // thread starts reading its queue
}
}*/

qDebug() << "### Create filter index";
qDebug() << "Create filter index: Start";
Expand All @@ -481,14 +481,14 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
if(!dltFile->getMsg(ix, *msg))
continue; // Skip broken messages

if(true == useIndexerThread)
/*if(true == useIndexerThread)
{
indexerThread.enqueueMessage(msg, ix);
}
else
{
{*/
indexerThread.processMessage(msg, ix);
}
//}

if((end-start)!=0)
iPercent = ( (ix-start)*100 )/(end-start);
Expand All @@ -503,23 +503,23 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
// stop if requested
if(stopFlag)
{
if(useIndexerThread)
/*if(useIndexerThread)
{
indexerThread.requestStop();
indexerThread.wait();
}
}*/

return false;
}
}
emit(progress(100));
qDebug() << "IF:" << 100 << "%";
qDebug() << "CFI:" << 100 << "%";
// destroy threads
if(true == useIndexerThread)
/*if(true == useIndexerThread)
{
indexerThread.requestStop();
indexerThread.wait();
}
}*/

// update performance counter
//msecsFilterCounter = time.elapsed();
Expand Down