Some small updates to the file analyzer benchmark code.
This commit is contained in:
parent
c18785ce1e
commit
23165c55a0
@ -518,6 +518,24 @@ void MainWindow::addFiles(const QStringList &files)
|
|||||||
|
|
||||||
int timeMT = 0, timeST = 0;
|
int timeMT = 0, timeST = 0;
|
||||||
|
|
||||||
|
//--Prepass--
|
||||||
|
|
||||||
|
FileAnalyzer_ST *analyzerPre = new FileAnalyzer_ST(files);
|
||||||
|
connect(analyzerPre, SIGNAL(fileSelected(QString)), m_banner, SLOT(setText(QString)), Qt::QueuedConnection);
|
||||||
|
connect(analyzerPre, SIGNAL(progressValChanged(unsigned int)), m_banner, SLOT(setProgressVal(unsigned int)), Qt::QueuedConnection);
|
||||||
|
connect(analyzerPre, SIGNAL(progressMaxChanged(unsigned int)), m_banner, SLOT(setProgressMax(unsigned int)), Qt::QueuedConnection);
|
||||||
|
connect(analyzerPre, SIGNAL(fileAnalyzed(AudioFileModel)), m_fileListModel, SLOT(addFile(AudioFileModel)), Qt::QueuedConnection);
|
||||||
|
connect(m_banner, SIGNAL(userAbort()), analyzerPre, SLOT(abortProcess()), Qt::DirectConnection);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_fileListModel->setBlockUpdates(true);
|
||||||
|
m_banner->show(tr("Adding file(s), please wait..."), analyzerPre);
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
/* ignore any exceptions that may occur */
|
||||||
|
}
|
||||||
//--MT--
|
//--MT--
|
||||||
|
|
||||||
FileAnalyzer *analyzer = new FileAnalyzer(files);
|
FileAnalyzer *analyzer = new FileAnalyzer(files);
|
||||||
@ -562,9 +580,16 @@ void MainWindow::addFiles(const QStringList &files)
|
|||||||
|
|
||||||
//------
|
//------
|
||||||
|
|
||||||
double speedUp = static_cast<double>(timeST) / static_cast<double>(timeMT);
|
if(timeST > 0 && timeMT > 0)
|
||||||
QMessageBox::information(this, "Speed Up", QString().sprintf("Announcement: The new multi-threaded file analyzer is %.1fx faster !!!", speedUp), QMessageBox::Ok);
|
{
|
||||||
qWarning("ST: %d, MT: %d", timeST, timeMT);
|
double speedUp = static_cast<double>(timeST) / static_cast<double>(timeMT);
|
||||||
|
qWarning("ST: %d, MT: %d", timeST, timeMT);
|
||||||
|
QMessageBox::information(this, "Speed Up", QString().sprintf("Announcement: The new multi-threaded file analyzer is %.1fx faster !!!", speedUp), QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, "Speed Up", "Couldn't compare the the new multi-threaded file analyzer this time!", QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
|
||||||
//------
|
//------
|
||||||
|
|
||||||
@ -594,6 +619,8 @@ void MainWindow::addFiles(const QStringList &files)
|
|||||||
|
|
||||||
LAMEXP_DELETE(analyzer);
|
LAMEXP_DELETE(analyzer);
|
||||||
LAMEXP_DELETE(analyzerST);
|
LAMEXP_DELETE(analyzerST);
|
||||||
|
LAMEXP_DELETE(analyzerPre);
|
||||||
|
|
||||||
m_banner->close();
|
m_banner->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user