mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Removed type erasure in containers
Summary: Refs T196 Using QVector as this is Qt's recommended container type. Reviewers: #swift_developers, rwinklmeier Reviewed By: #swift_developers, rwinklmeier Subscribers: rwinklmeier, jenkins Tags: #swift_pilot_client Maniphest Tasks: T196 Differential Revision: https://dev.swift-project.org/D61
This commit is contained in:
@@ -184,101 +184,6 @@ namespace BlackSample
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CSamplesPerformance::samplesImplementationType(QTextStream &out, int numberOfCallsigns, int numberOfTimes)
|
||||
{
|
||||
const qint64 baseTimeEpoch = QDateTime::currentMSecsSinceEpoch();
|
||||
CAircraftSituationList situations = createSituations(baseTimeEpoch, numberOfCallsigns, numberOfTimes);
|
||||
|
||||
QTime timer;
|
||||
out << "Created " << situations.size() << " situations" << endl;
|
||||
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int cs = 0; cs < numberOfCallsigns; cs++)
|
||||
{
|
||||
CCallsign callsign("CS" + QString::number(cs));
|
||||
CAircraftSituationList r = situations.findByCallsign(callsign);
|
||||
Q_ASSERT(r.size() == numberOfTimes);
|
||||
}
|
||||
}
|
||||
out << "Reads by callsigns: " << timer.elapsed() << "ms" << endl;
|
||||
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int t = 0; t < numberOfTimes; t++)
|
||||
{
|
||||
CAircraftSituationList r = situations.findBefore(baseTimeEpoch + 1 + (DeltaTime * t));
|
||||
Q_ASSERT(r.size() == numberOfCallsigns * (t + 1));
|
||||
}
|
||||
}
|
||||
out << "Reads by times: " << timer.elapsed() << "ms" << endl;
|
||||
|
||||
timer.start();
|
||||
for (int t = 0; t < numberOfTimes; t++)
|
||||
{
|
||||
for (int cs = 0; cs < numberOfCallsigns; cs++)
|
||||
{
|
||||
CCallsign callsign("CS" + QString::number(cs));
|
||||
CAircraftSituationList r = situations.findByCallsign(callsign).findBefore(baseTimeEpoch + 1 + (DeltaTime * t));
|
||||
Q_UNUSED(r);
|
||||
}
|
||||
}
|
||||
out << "Reads by callsigns / times: " << timer.elapsed() << "ms" << endl;
|
||||
|
||||
timer.start();
|
||||
for (int t = 0; t < numberOfTimes; t++)
|
||||
{
|
||||
for (int cs = 0; cs < numberOfCallsigns; cs++)
|
||||
{
|
||||
CCallsign callsign("CS" + QString::number(cs));
|
||||
CAircraftSituationList r = situations.findBefore(baseTimeEpoch + 1 + (DeltaTime * t)).findByCallsign(callsign);
|
||||
Q_UNUSED(r);
|
||||
}
|
||||
}
|
||||
out << "Reads by times / callsigns: " << timer.elapsed() << "ms" << endl;
|
||||
|
||||
timer.start();
|
||||
const QHash<CCallsign, CAircraftSituationList> splitList = situations.splitPerCallsign();
|
||||
Q_ASSERT(splitList.size() == numberOfCallsigns);
|
||||
for (int t = 0; t < numberOfTimes; t++)
|
||||
{
|
||||
for (const CAircraftSituationList &slcs : splitList)
|
||||
{
|
||||
CAircraftSituationList r = slcs.findBefore(baseTimeEpoch + 1 + (DeltaTime * t));
|
||||
Q_UNUSED(r);
|
||||
}
|
||||
}
|
||||
out << "Split reads by callsigns / times: " << timer.elapsed() << "ms" << endl;
|
||||
|
||||
situations.changeImpl<QVector<CAircraftSituation> >();
|
||||
out << "Changed to QVector" << endl;
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int cs = 0; cs < numberOfCallsigns; cs++)
|
||||
{
|
||||
CCallsign callsign("CS" + QString::number(cs));
|
||||
CAircraftSituationList r = situations.findByCallsign(callsign);
|
||||
Q_ASSERT(r.size() == numberOfTimes);
|
||||
}
|
||||
}
|
||||
out << "Reads by callsigns: " << timer.elapsed() << "ms" << endl;
|
||||
|
||||
timer.start();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
for (int t = 0; t < numberOfTimes; t++)
|
||||
{
|
||||
CAircraftSituationList r = situations.findBefore(baseTimeEpoch + 1 + (DeltaTime * t));
|
||||
Q_ASSERT(r.size() == numberOfCallsigns * (t + 1));
|
||||
}
|
||||
}
|
||||
out << "Reads by times: " << timer.elapsed() << "ms" << endl << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CSamplesPerformance::interpolatorScenario(QTextStream &out, int numberOfCallsigns, int numberOfTimes)
|
||||
{
|
||||
const qint64 baseTimeEpoch = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
Reference in New Issue
Block a user