git-svn-id: svn://db.shs.com.ru/libs@586 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
56
test/qcd_utils/pult/main.cpp
Normal file
56
test/qcd_utils/pult/main.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user