57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#include <QApplication>
|
|
#include "cdpultwindow.h"
|
|
|
|
|
|
inline uint qHash(const PIString &t) {
|
|
return t.hash();
|
|
}
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
QApplication a(argc, argv);
|
|
#if QT_VERSION >= 0x050000
|
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
|
#endif
|
|
//################################
|
|
QHash<int, PIString> h2;
|
|
QMap<int, PIString> m2;
|
|
PIVector<int> keys;
|
|
PIString prefix = "1234567890fgbjyfjyjbghjkbgkbgjgsfh jhfgj ghfjhjfjf";
|
|
PITimeMeasurer tm;
|
|
double el = 0.;
|
|
for (int i=0; i<100000; ++i) keys << randomi();
|
|
piCout << keys.size();
|
|
|
|
tm.reset();
|
|
for (int i=0; i<100000; ++i) {
|
|
h2[keys[i]] = prefix;
|
|
}
|
|
el = tm.elapsed_m(); piCout << el << h2.capacity() << h2.size();
|
|
|
|
tm.reset();
|
|
for (int i=0; i<100000; ++i) {
|
|
m2[keys[i]] = prefix;
|
|
}
|
|
el = tm.elapsed_m(); piCout << el;
|
|
piCout << "*********";
|
|
|
|
PIString _s;
|
|
tm.reset();
|
|
for (int i=0; i<100000; ++i) {
|
|
_s = h2.value(keys[i]);
|
|
}
|
|
el = tm.elapsed_m(); piCout << el << h2.capacity();
|
|
|
|
tm.reset();
|
|
for (int i=0; i<100000; ++i) {
|
|
_s = m2.value(keys[i]);
|
|
}
|
|
el = tm.elapsed_m(); piCout << el;
|
|
//################################
|
|
CDPultWindow w;
|
|
w.show();
|
|
if (a.arguments().size() > 1)
|
|
w.loadFile(a.arguments()[1]);
|
|
return a.exec();
|
|
}
|