Some small updates to the file analyzer benchmark code.

This commit is contained in:
LoRd_MuldeR 2012-05-15 21:34:20 +02:00
parent c18785ce1e
commit 23165c55a0

View File

@ -518,6 +518,24 @@ void MainWindow::addFiles(const QStringList &files)
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--
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);
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);
if(timeST > 0 && timeMT > 0)
{
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(analyzerST);
LAMEXP_DELETE(analyzerPre);
m_banner->close();
}