git-svn-id: svn://db.shs.com.ru/libs@584 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -2,41 +2,49 @@
|
|||||||
#include "cdpultwindow.h"
|
#include "cdpultwindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
inline uint qHash(const PIString &t) {
|
||||||
|
return t.hash();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
#endif
|
#endif
|
||||||
//################################
|
//################################
|
||||||
QHash<QString, QString> h2;
|
QHash<int, PIString> h2;
|
||||||
QMap<QString, QString> m2;
|
QMap<int, PIString> m2;
|
||||||
QString prefix = "1234567890";
|
PIVector<int> keys;
|
||||||
|
PIString prefix = "1234567890fgbjyfjyjbghjkbgkbgjgsfh jhfgj ghfjhjfjf";
|
||||||
PITimeMeasurer tm;
|
PITimeMeasurer tm;
|
||||||
double el = 0.;
|
double el = 0.;
|
||||||
|
for (int i=0; i<100000; ++i) keys << randomi();
|
||||||
|
piCout << keys.size();
|
||||||
|
|
||||||
tm.reset();
|
tm.reset();
|
||||||
for (int i=0; i<10000; ++i) {
|
for (int i=0; i<100000; ++i) {
|
||||||
h2[prefix + QString::number(i)+"1234567890"] = QString::number(randomi());
|
h2[keys[i]] = prefix;
|
||||||
}
|
}
|
||||||
el = tm.elapsed_m(); piCout << el << h2.capacity();
|
el = tm.elapsed_m(); piCout << el << h2.capacity() << h2.size();
|
||||||
|
|
||||||
tm.reset();
|
tm.reset();
|
||||||
for (int i=0; i<10000; ++i) {
|
for (int i=0; i<100000; ++i) {
|
||||||
m2[prefix + QString::number(i)+"1234567890"] = QString::number(randomi());
|
m2[keys[i]] = prefix;
|
||||||
}
|
}
|
||||||
el = tm.elapsed_m(); piCout << el;
|
el = tm.elapsed_m(); piCout << el;
|
||||||
piCout << "*********";
|
piCout << "*********";
|
||||||
|
|
||||||
QString _s;
|
PIString _s;
|
||||||
tm.reset();
|
tm.reset();
|
||||||
for (int i=0; i<10000; ++i) {
|
for (int i=0; i<100000; ++i) {
|
||||||
_s = h2.value(prefix + QString::number(i)+"1234567890");
|
_s = h2.value(keys[i]);
|
||||||
}
|
}
|
||||||
el = tm.elapsed_m(); piCout << el << h2.capacity();
|
el = tm.elapsed_m(); piCout << el << h2.capacity();
|
||||||
|
|
||||||
tm.reset();
|
tm.reset();
|
||||||
for (int i=0; i<10000; ++i) {
|
for (int i=0; i<100000; ++i) {
|
||||||
_s = m2.value(prefix + QString::number(i)+"1234567890");
|
_s = m2.value(keys[i]);
|
||||||
}
|
}
|
||||||
el = tm.elapsed_m(); piCout << el;
|
el = tm.elapsed_m(); piCout << el;
|
||||||
//################################
|
//################################
|
||||||
|
|||||||
Reference in New Issue
Block a user