diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-07-12 12:52:22 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-07-12 12:52:22 +0200 |
commit | 2371147354d4436bb54c588662ac315dd4c2f940 (patch) | |
tree | 5c90b1dd18de394cff2fb4e1bedc628da3c7d341 /tests/benchmarks | |
parent | 54ec6d177e0e8fb04cd01e70461484a80ca1f7a4 (diff) | |
parent | 82454b6014a7ee0b048b4db8d64a21de849d4ab9 (diff) | |
download | qtbase-2371147354d4436bb54c588662ac315dd4c2f940.tar.gz |
Merge remote branch 'gerrit/master' into refactor
Conflicts:
src/gui/image/qicon.cpp
src/gui/image/qicon.h
src/gui/image/qicon_p.h
src/gui/text/qfontdatabase.cpp
src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp
src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
sync.profile
Change-Id: Ie0a23a12177ff51bf562e15b2dd41f071afb19b4
Diffstat (limited to 'tests/benchmarks')
5 files changed, 87 insertions, 5 deletions
diff --git a/tests/benchmarks/corelib/io/qurl/main.cpp b/tests/benchmarks/corelib/io/qurl/main.cpp index ca6ec882f4..7e5035f250 100644 --- a/tests/benchmarks/corelib/io/qurl/main.cpp +++ b/tests/benchmarks/corelib/io/qurl/main.cpp @@ -229,7 +229,7 @@ void tst_qurl::equality() void tst_qurl::qmlPropertyWriteUseCase() { - QUrl base("file:///home/user/qt/demos/declarative/samegame/SamegameCore/"); + QUrl base("file:///home/user/qt/examples/declarative/samegame/SamegameCore/"); QString str("pics/redStar.png"); QBENCHMARK { diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro index 53fa23b981..0135a24f94 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro @@ -12,8 +12,8 @@ build_all:!build_pass { } # install -target.path = $$[QT_INSTALL_DEMOS]/chip +target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/chip sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.pro *.html *.doc images -sources.path = $$[QT_INSTALL_DEMOS]/chip +sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/chip INSTALLS += target sources diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp index e7969d2bee..4c6289ea95 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp @@ -56,7 +56,7 @@ MainWindow::MainWindow(QWidget *parent) layout->addWidget(view); setLayout(layout); - setWindowTitle(tr("Chip Demo")); + setWindowTitle(tr("Chip Example")); } void MainWindow::populateScene() diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp index 994b53e382..c6167e50cb 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp @@ -60,7 +60,7 @@ ChipTester::ChipTester(QWidget *parent) populateScene(); setScene(scene); - setWindowTitle(tr("Chip Demo")); + setWindowTitle(tr("Chip Example")); } void ChipTester::setAntialias(bool enabled) diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index dc06e420fd..d96b110d54 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -469,6 +469,7 @@ private slots: void httpDownloadPerformance(); void httpDownloadPerformanceDownloadBuffer_data(); void httpDownloadPerformanceDownloadBuffer(); + void httpsRequestChain(); }; void tst_qnetworkreply::httpLatency() @@ -739,6 +740,87 @@ void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer() } } + +class HttpsRequestChainHelper : public QObject { + Q_OBJECT +public: + QList<QNetworkRequest> requestList; + + QElapsedTimer timeOneRequest; + QList<qint64> timeList; + + QElapsedTimer globalTime; + + QNetworkAccessManager manager; + + HttpsRequestChainHelper() { + } +public slots: + void doNextRequest() { + // all requests done + if (requestList.isEmpty()) { + QTestEventLoop::instance().exitLoop(); + return; + } + + if (qobject_cast<QNetworkReply*>(sender()) == 0) { + // first start after DNS lookup, start timer + globalTime.start(); + } + QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); + if (reply) { + QVERIFY(reply->error() == QNetworkReply::NoError); + qDebug() << "time =" << timeOneRequest.elapsed() << "ms"; + timeList.append(timeOneRequest.elapsed()); + } + + QNetworkRequest request = requestList.takeFirst(); + timeOneRequest.restart(); + reply = manager.get(request); + QObject::connect(reply, SIGNAL(sslErrors( const QList<QSslError> &)), reply, SLOT(ignoreSslErrors())); + QObject::connect(reply, SIGNAL(finished()), this, SLOT(doNextRequest())); + } + +}; + +void tst_qnetworkreply::httpsRequestChain() +{ + int count = 10; + + QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + "/fluke.gif")); + //QNetworkRequest request(QUrl("https://www.nokia.com/robots.txt")); + // Disable keep-alive so we have the full re-connecting of TCP. + request.setRawHeader("Connection", "close"); + + HttpsRequestChainHelper helper; + for (int i = 0; i < count; i++) + helper.requestList.append(request); + + // Warm up DNS cache and then immediatly start HTTP + QHostInfo::lookupHost(QtNetworkSettings::serverName(), &helper, SLOT(doNextRequest())); + //QHostInfo::lookupHost("www.nokia.com", &helper, SLOT(doNextRequest())); + + // we can use QBENCHMARK_ONCE when we find out how to make it really run once. + // there is still a warmup-run :( + + //QBENCHMARK_ONCE { + QTestEventLoop::instance().enterLoop(40); + QVERIFY(!QTestEventLoop::instance().timeout()); + //} + + qint64 elapsed = helper.globalTime.elapsed(); + + qint64 average = (elapsed / count); + + qSort(helper.timeList); + qint64 median = helper.timeList.at(5); + + qDebug() << "Total:" << elapsed << " Average:" << average << " Median:" << median; + +} + + + QTEST_MAIN(tst_qnetworkreply) #include "tst_qnetworkreply.moc" |