diff options
Diffstat (limited to 'tests/benchmarks/corelib')
-rw-r--r-- | tests/benchmarks/corelib/corelib.pro | 2 | ||||
-rw-r--r-- | tests/benchmarks/corelib/io/qdiriterator/main.cpp | 24 | ||||
-rw-r--r-- | tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp | 5 | ||||
-rw-r--r-- | tests/benchmarks/corelib/kernel/kernel.pro | 3 | ||||
-rw-r--r-- | tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp | 88 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qbytearray/main.cpp (renamed from tests/benchmarks/corelib/tools/qbytearray/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qbytearray/qbytearray.pro (renamed from tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qchar/main.cpp (renamed from tests/benchmarks/corelib/tools/qchar/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qchar/qchar.pro (renamed from tests/benchmarks/corelib/tools/qchar/qchar.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qlocale/main.cpp (renamed from tests/benchmarks/corelib/tools/qlocale/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qlocale/qlocale.pro (renamed from tests/benchmarks/corelib/tools/qlocale/qlocale.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qregexp/main.cpp (renamed from tests/benchmarks/corelib/tools/qregexp/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qregexp/qregexp.pro (renamed from tests/benchmarks/corelib/tools/qregexp/qregexp.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qregexp/qregexp.qrc (renamed from tests/benchmarks/corelib/tools/qregexp/qregexp.qrc) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstring/main.cpp (renamed from tests/benchmarks/corelib/tools/qstring/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstring/qstring.pro (renamed from tests/benchmarks/corelib/tools/qstring/qstring.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstringbuilder/main.cpp (renamed from tests/benchmarks/corelib/tools/qstringbuilder/main.cpp) | 2 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstringbuilder/qstringbuilder.pro (renamed from tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstringlist/.gitignore (renamed from tests/benchmarks/corelib/tools/qstringlist/.gitignore) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstringlist/main.cpp (renamed from tests/benchmarks/corelib/tools/qstringlist/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/qstringlist/qstringlist.pro (renamed from tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/text/text.pro | 10 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/qdate/qdate.pro | 4 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp | 53 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/qdatetime/main.cpp (renamed from tests/benchmarks/corelib/tools/qdatetime/main.cpp) | 5 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/qdatetime/qdatetime.pro (renamed from tests/benchmarks/corelib/tools/qdatetime/qdatetime.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/qtimezone/main.cpp (renamed from tests/benchmarks/corelib/tools/qtimezone/main.cpp) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/qtimezone/qtimezone.pro (renamed from tests/benchmarks/corelib/tools/qtimezone/qtimezone.pro) | 0 | ||||
-rw-r--r-- | tests/benchmarks/corelib/time/time.pro | 5 | ||||
-rw-r--r-- | tests/benchmarks/corelib/tools/qhash/paths_small_data.txt | 56 | ||||
-rw-r--r-- | tests/benchmarks/corelib/tools/qvector/qrawvector.h | 7 | ||||
-rw-r--r-- | tests/benchmarks/corelib/tools/tools.pro | 9 |
32 files changed, 198 insertions, 75 deletions
diff --git a/tests/benchmarks/corelib/corelib.pro b/tests/benchmarks/corelib/corelib.pro index b5781ad49e..010abd7751 100644 --- a/tests/benchmarks/corelib/corelib.pro +++ b/tests/benchmarks/corelib/corelib.pro @@ -4,7 +4,9 @@ SUBDIRS = \ json \ mimetypes \ kernel \ + text \ thread \ + time \ tools \ codecs \ plugin diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp index e71daccf7d..eae752d99a 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp @@ -78,24 +78,22 @@ void tst_qdiriterator::data() } #ifdef Q_OS_WIN -static int posix_helper(const wchar_t *dirpath) +static int posix_helper(const wchar_t *dirpath, size_t length) { int count = 0; HANDLE hSearch; WIN32_FIND_DATA fd; - const size_t origDirPathLength = wcslen(dirpath); - wchar_t appendedPath[MAX_PATH]; - wcscpy(appendedPath, dirpath); - wcscat(appendedPath, L"\\*"); + Q_ASSERT(MAX_PATH > length + 3); + wcsncpy(appendedPath, dirpath, length); + wcscpy(appendedPath + length, L"\\*"); #ifndef Q_OS_WINRT hSearch = FindFirstFile(appendedPath, &fd); #else hSearch = FindFirstFileEx(appendedPath, FindExInfoStandard, &fd, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); #endif - appendedPath[origDirPathLength] = 0; if (hSearch == INVALID_HANDLE_VALUE) { qWarning("FindFirstFile failed"); @@ -107,10 +105,12 @@ static int posix_helper(const wchar_t *dirpath) !(fd.cFileName[0] == L'.' && fd.cFileName[1] == L'.' && fd.cFileName[2] == 0)) { if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - wcscat(appendedPath, L"\\"); - wcscat(appendedPath, fd.cFileName); - count += posix_helper(appendedPath); - appendedPath[origDirPathLength] = 0; + // newLength will "point" to where we put a * earlier, so we overwrite that. + size_t newLength = length + 1; // "+ 1" for directory separator + Q_ASSERT(newLength + wcslen(fd.cFileName) + 1 < MAX_PATH); // "+ 1" for null-terminator + wcscpy(appendedPath + newLength, fd.cFileName); + newLength += wcslen(fd.cFileName); + count += posix_helper(appendedPath, newLength); } else { ++count; @@ -164,8 +164,8 @@ void tst_qdiriterator::posix() QBENCHMARK { #ifdef Q_OS_WIN wchar_t wPath[MAX_PATH]; - path.toWCharArray(wPath); - count = posix_helper(wPath); + const int end = path.toWCharArray(wPath); + count = posix_helper(wPath, end); #else count = posix_helper(dirpath.constData()); #endif diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp index d68264b78f..6ee8b4e93b 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp @@ -218,8 +218,9 @@ void QFileSystemIteratorPrivate::pushSubDirectory(const QByteArray &path) #ifdef Q_OS_WIN wchar_t szSearchPath[MAX_PATH]; - QString::fromLatin1(path).toWCharArray(szSearchPath); - wcscat(szSearchPath, L"\\*"); + const int end = QString::fromLatin1(path + "\\*").toWCharArray(szSearchPath); + Q_ASSERT(end < MAX_PATH); + szSearchPath[end] = L'\0'; #ifndef Q_OS_WINRT HANDLE dir = FindFirstFile(szSearchPath, &m_fileSearchResult); #else diff --git a/tests/benchmarks/corelib/kernel/kernel.pro b/tests/benchmarks/corelib/kernel/kernel.pro index 02eeeaa254..92f7174419 100644 --- a/tests/benchmarks/corelib/kernel/kernel.pro +++ b/tests/benchmarks/corelib/kernel/kernel.pro @@ -5,7 +5,8 @@ SUBDIRS = \ qmetatype \ qobject \ qvariant \ - qcoreapplication + qcoreapplication \ + qtimer_vs_qmetaobject !qtHaveModule(widgets): SUBDIRS -= \ qmetaobject \ diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp index 66a29780f0..6af5b8d586 100644 --- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp +++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp @@ -28,6 +28,7 @@ #include <QtCore> #include <QtTest/QtTest> +#include <QThread> #define INVOKE_COUNT 10000 @@ -35,8 +36,10 @@ class qtimer_vs_qmetaobject : public QObject { Q_OBJECT private slots: - void testZeroTimerSingleShot(); - void testQueuedInvokeMethod(); + void bench(); + void bench_data(); + void benchBackgroundThread(); + void benchBackgroundThread_data() { bench_data(); } }; class InvokeCounter : public QObject { @@ -47,36 +50,89 @@ public slots: void invokeSlot() { count++; if (count == INVOKE_COUNT) - QTestEventLoop::instance().exitLoop(); + emit allInvoked(); } +signals: + void allInvoked(); protected: int count; }; -void qtimer_vs_qmetaobject::testZeroTimerSingleShot() +void qtimer_vs_qmetaobject::bench() { + QFETCH(int, type); + + std::function<void(InvokeCounter*)> invoke; + if (type == 0) { + invoke = [](InvokeCounter* invokeCounter) { + QTimer::singleShot(0, invokeCounter, SLOT(invokeSlot())); + }; + } else if (type == 1) { + invoke = [](InvokeCounter* invokeCounter) { + QTimer::singleShot(0, invokeCounter, &InvokeCounter::invokeSlot); + }; + } else if (type == 2) { + invoke = [](InvokeCounter* invokeCounter) { + QTimer::singleShot(0, invokeCounter, [invokeCounter]() { + invokeCounter->invokeSlot(); + }); + }; + } else if (type == 3) { + invoke = [](InvokeCounter* invokeCounter) { + QTimer::singleShot(0, [invokeCounter]() { + invokeCounter->invokeSlot(); + }); + }; + } else if (type == 4) { + invoke = [](InvokeCounter* invokeCounter) { + QMetaObject::invokeMethod(invokeCounter, "invokeSlot", Qt::QueuedConnection); + }; + } else if (type == 5) { + invoke = [](InvokeCounter* invokeCounter) { + QMetaObject::invokeMethod(invokeCounter, &InvokeCounter::invokeSlot, Qt::QueuedConnection); + }; + } else if (type == 6) { + invoke = [](InvokeCounter* invokeCounter) { + QMetaObject::invokeMethod(invokeCounter, [invokeCounter]() { + invokeCounter->invokeSlot(); + }, Qt::QueuedConnection); + }; + } else { + QFAIL("unhandled data tag"); + } + QBENCHMARK { InvokeCounter invokeCounter; + QSignalSpy spy(&invokeCounter, &InvokeCounter::allInvoked); for(int i = 0; i < INVOKE_COUNT; ++i) { - QTimer::singleShot(0, &invokeCounter, SLOT(invokeSlot())); + invoke(&invokeCounter); } - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(spy.wait(10000)); } } -void qtimer_vs_qmetaobject::testQueuedInvokeMethod() +void qtimer_vs_qmetaobject::bench_data() { - QBENCHMARK { - InvokeCounter invokeCounter; - for(int i = 0; i < INVOKE_COUNT; ++i) { - QMetaObject::invokeMethod(&invokeCounter, "invokeSlot", Qt::QueuedConnection); - } - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - } + QTest::addColumn<int>("type"); + QTest::addRow("singleShot_slot") << 0; + QTest::addRow("singleShot_pmf") << 1; + QTest::addRow("singleShot_functor") << 2; + QTest::addRow("singleShot_functor_noctx") << 3; + QTest::addRow("invokeMethod_string") << 4; + QTest::addRow("invokeMethod_pmf") << 5; + QTest::addRow("invokeMethod_functor") << 6; } +void qtimer_vs_qmetaobject::benchBackgroundThread() +{ +#if !QT_CONFIG(cxx11_future) + QSKIP("This test requires QThread::create"); +#else + QScopedPointer<QThread> thread(QThread::create([this]() { bench(); })); + thread->start(); + QVERIFY(thread->wait()); +#endif +} QTEST_MAIN(qtimer_vs_qmetaobject) diff --git a/tests/benchmarks/corelib/tools/qbytearray/main.cpp b/tests/benchmarks/corelib/text/qbytearray/main.cpp index e421e7436b..e421e7436b 100644 --- a/tests/benchmarks/corelib/tools/qbytearray/main.cpp +++ b/tests/benchmarks/corelib/text/qbytearray/main.cpp diff --git a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro b/tests/benchmarks/corelib/text/qbytearray/qbytearray.pro index cf28b0247f..cf28b0247f 100644 --- a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro +++ b/tests/benchmarks/corelib/text/qbytearray/qbytearray.pro diff --git a/tests/benchmarks/corelib/tools/qchar/main.cpp b/tests/benchmarks/corelib/text/qchar/main.cpp index 4dcf86786d..4dcf86786d 100644 --- a/tests/benchmarks/corelib/tools/qchar/main.cpp +++ b/tests/benchmarks/corelib/text/qchar/main.cpp diff --git a/tests/benchmarks/corelib/tools/qchar/qchar.pro b/tests/benchmarks/corelib/text/qchar/qchar.pro index 80a9861f48..80a9861f48 100644 --- a/tests/benchmarks/corelib/tools/qchar/qchar.pro +++ b/tests/benchmarks/corelib/text/qchar/qchar.pro diff --git a/tests/benchmarks/corelib/tools/qlocale/main.cpp b/tests/benchmarks/corelib/text/qlocale/main.cpp index 38d94af143..38d94af143 100644 --- a/tests/benchmarks/corelib/tools/qlocale/main.cpp +++ b/tests/benchmarks/corelib/text/qlocale/main.cpp diff --git a/tests/benchmarks/corelib/tools/qlocale/qlocale.pro b/tests/benchmarks/corelib/text/qlocale/qlocale.pro index e56bbe0341..e56bbe0341 100644 --- a/tests/benchmarks/corelib/tools/qlocale/qlocale.pro +++ b/tests/benchmarks/corelib/text/qlocale/qlocale.pro diff --git a/tests/benchmarks/corelib/tools/qregexp/main.cpp b/tests/benchmarks/corelib/text/qregexp/main.cpp index 798b23f2b0..798b23f2b0 100644 --- a/tests/benchmarks/corelib/tools/qregexp/main.cpp +++ b/tests/benchmarks/corelib/text/qregexp/main.cpp diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/text/qregexp/qregexp.pro index f64ae781a2..f64ae781a2 100644 --- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro +++ b/tests/benchmarks/corelib/text/qregexp/qregexp.pro diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.qrc b/tests/benchmarks/corelib/text/qregexp/qregexp.qrc index a7fe13c035..a7fe13c035 100644 --- a/tests/benchmarks/corelib/tools/qregexp/qregexp.qrc +++ b/tests/benchmarks/corelib/text/qregexp/qregexp.qrc diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/text/qstring/main.cpp index 826a843c10..826a843c10 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/text/qstring/main.cpp diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/text/qstring/qstring.pro index 9f5e34b915..9f5e34b915 100644 --- a/tests/benchmarks/corelib/tools/qstring/qstring.pro +++ b/tests/benchmarks/corelib/text/qstring/qstring.pro diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp b/tests/benchmarks/corelib/text/qstringbuilder/main.cpp index d0dfe3b1a7..0de6d33846 100644 --- a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp +++ b/tests/benchmarks/corelib/text/qstringbuilder/main.cpp @@ -401,7 +401,7 @@ private slots: } private: - const QLatin1Literal l1literal; + const QLatin1String l1literal; const QLatin1String l1string; const QByteArray ba; const QString string; diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro b/tests/benchmarks/corelib/text/qstringbuilder/qstringbuilder.pro index fa4cbe3c13..fa4cbe3c13 100644 --- a/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro +++ b/tests/benchmarks/corelib/text/qstringbuilder/qstringbuilder.pro diff --git a/tests/benchmarks/corelib/tools/qstringlist/.gitignore b/tests/benchmarks/corelib/text/qstringlist/.gitignore index 3e0cdc952f..3e0cdc952f 100644 --- a/tests/benchmarks/corelib/tools/qstringlist/.gitignore +++ b/tests/benchmarks/corelib/text/qstringlist/.gitignore diff --git a/tests/benchmarks/corelib/tools/qstringlist/main.cpp b/tests/benchmarks/corelib/text/qstringlist/main.cpp index ae355a8b89..ae355a8b89 100644 --- a/tests/benchmarks/corelib/tools/qstringlist/main.cpp +++ b/tests/benchmarks/corelib/text/qstringlist/main.cpp diff --git a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro b/tests/benchmarks/corelib/text/qstringlist/qstringlist.pro index 5803e7da0e..5803e7da0e 100644 --- a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro +++ b/tests/benchmarks/corelib/text/qstringlist/qstringlist.pro diff --git a/tests/benchmarks/corelib/text/text.pro b/tests/benchmarks/corelib/text/text.pro new file mode 100644 index 0000000000..8c15d0b0c5 --- /dev/null +++ b/tests/benchmarks/corelib/text/text.pro @@ -0,0 +1,10 @@ +TEMPLATE = subdirs +SUBDIRS = \ + qbytearray \ + qchar \ + qlocale \ + qregexp \ + qstringbuilder \ + qstringlist + +*g++*: SUBDIRS += qstring diff --git a/tests/benchmarks/corelib/time/qdate/qdate.pro b/tests/benchmarks/corelib/time/qdate/qdate.pro new file mode 100644 index 0000000000..a655917135 --- /dev/null +++ b/tests/benchmarks/corelib/time/qdate/qdate.pro @@ -0,0 +1,4 @@ +TARGET = tst_bench_qdate +QT = core testlib + +SOURCES += tst_bench_qdate.cpp diff --git a/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp b/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp new file mode 100644 index 0000000000..399ac44065 --- /dev/null +++ b/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QDateTime> +#include <QTest> + +class tst_QDate : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void monthLengths(); +}; + +void tst_QDate::monthLengths() +{ + QBENCHMARK { + for (int year = 1900; year <= 2100; year++) { + bool check = true; + for (int month = 1; month <= 12; month++) + check &= QDate::isValid(year, month, QDate(year, month, 1).daysInMonth()); + Q_UNUSED(check); + } + } +} + +QTEST_MAIN(tst_QDate) +#include "tst_bench_qdate.moc" diff --git a/tests/benchmarks/corelib/tools/qdatetime/main.cpp b/tests/benchmarks/corelib/time/qdatetime/main.cpp index 2c1e3d97ae..b693400376 100644 --- a/tests/benchmarks/corelib/tools/qdatetime/main.cpp +++ b/tests/benchmarks/corelib/time/qdatetime/main.cpp @@ -35,10 +35,7 @@ class tst_QDateTime : public QObject { Q_OBJECT - enum -#if defined(Q_COMPILER_CLASS_ENUM) || (defined(Q_CC_MSVC) && _MSC_VER >= 1700) - : qint64 -#endif + enum : qint64 { SECS_PER_DAY = 86400, MSECS_PER_DAY = 86400000, diff --git a/tests/benchmarks/corelib/tools/qdatetime/qdatetime.pro b/tests/benchmarks/corelib/time/qdatetime/qdatetime.pro index a85e7346c6..a85e7346c6 100644 --- a/tests/benchmarks/corelib/tools/qdatetime/qdatetime.pro +++ b/tests/benchmarks/corelib/time/qdatetime/qdatetime.pro diff --git a/tests/benchmarks/corelib/tools/qtimezone/main.cpp b/tests/benchmarks/corelib/time/qtimezone/main.cpp index 65455a7261..65455a7261 100644 --- a/tests/benchmarks/corelib/tools/qtimezone/main.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/main.cpp diff --git a/tests/benchmarks/corelib/tools/qtimezone/qtimezone.pro b/tests/benchmarks/corelib/time/qtimezone/qtimezone.pro index d0531b568b..d0531b568b 100644 --- a/tests/benchmarks/corelib/tools/qtimezone/qtimezone.pro +++ b/tests/benchmarks/corelib/time/qtimezone/qtimezone.pro diff --git a/tests/benchmarks/corelib/time/time.pro b/tests/benchmarks/corelib/time/time.pro new file mode 100644 index 0000000000..b5184845d9 --- /dev/null +++ b/tests/benchmarks/corelib/time/time.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs +SUBDIRS = \ + qdate \ + qdatetime \ + qtimezone diff --git a/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt b/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt index d5acd28820..662285296f 100644 --- a/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt +++ b/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt @@ -47,13 +47,38 @@ ./codecs/.obj/debug-shared ./.pch ./.pch/debug-shared +./text +./text/text.pro +./text/qregexp +./text/qregexp/qregexp.qrc +./text/qregexp/main.cpp +./text/qregexp/Makefile +./text/qregexp/qregexp.pro +./text/qstringbuilder +./text/qstringbuilder/main.cpp +./text/qstringbuilder/Makefile +./text/qstringbuilder/qstringbuilder.pro +./text/qstring +./text/qstring/generatelist.pl +./text/qstring/data.h +./text/qstring/qstring.pro +./text/qstring/main.cpp +./text/qstring/data.cpp +./text/qstring/Makefile +./text/qstring/utf-8.txt +./text/qstringlist +./text/qstringlist/qstringlist.pro +./text/qstringlist/main.cpp +./text/qstringlist/.gitignore +./text/qstringlist/Makefile +./text/qbytearray +./text/qbytearray/qbytearray.pro +./text/qbytearray/main.cpp +./text/qbytearray/Makefile +./text/.pch +./text/.pch/debug-shared ./tools ./tools/tools.pro -./tools/qregexp -./tools/qregexp/qregexp.qrc -./tools/qregexp/main.cpp -./tools/qregexp/Makefile -./tools/qregexp/qregexp.pro ./tools/qvector ./tools/qvector/tst_vector ./tools/qvector/.pch @@ -72,31 +97,10 @@ ./tools/qvector/qvector.pro ./tools/.pch ./tools/.pch/debug-shared -./tools/qstringbuilder -./tools/qstringbuilder/main.cpp -./tools/qstringbuilder/Makefile -./tools/qstringbuilder/qstringbuilder.pro ./tools/containers-sequential ./tools/containers-sequential/containers-sequential.pro ./tools/containers-sequential/main.cpp ./tools/containers-sequential/Makefile -./tools/qstring -./tools/qstring/generatelist.pl -./tools/qstring/data.h -./tools/qstring/qstring.pro -./tools/qstring/main.cpp -./tools/qstring/data.cpp -./tools/qstring/Makefile -./tools/qstring/utf-8.txt -./tools/qstringlist -./tools/qstringlist/qstringlist.pro -./tools/qstringlist/main.cpp -./tools/qstringlist/.gitignore -./tools/qstringlist/Makefile -./tools/qbytearray -./tools/qbytearray/qbytearray.pro -./tools/qbytearray/main.cpp -./tools/qbytearray/Makefile ./tools/containers-associative ./tools/containers-associative/containers-associative.pro ./tools/containers-associative/main.cpp diff --git a/tests/benchmarks/corelib/tools/qvector/qrawvector.h b/tests/benchmarks/corelib/tools/qvector/qrawvector.h index c7173b5b8d..16a911c63a 100644 --- a/tests/benchmarks/corelib/tools/qvector/qrawvector.h +++ b/tests/benchmarks/corelib/tools/qvector/qrawvector.h @@ -32,7 +32,6 @@ #include <QtCore/qiterator.h> #include <QtCore/qdebug.h> #include <QtCore/qatomic.h> -#include <QtCore/qalgorithms.h> #include <QtCore/qlist.h> #include <QtCore/private/qtools_p.h> @@ -263,9 +262,9 @@ public: //static QRawVector<T> fromList(const QList<T> &list); static inline QRawVector<T> fromStdVector(const std::vector<T> &vector) - { QRawVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } + { QRawVector<T> tmp; std::copy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } inline std::vector<T> toStdVector() const - { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } + { std::vector<T> tmp; std::copy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } private: T *allocate(int alloc); @@ -568,7 +567,7 @@ typename QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator int l = int(aend - m_begin); int n = l - f; if (QTypeInfo<T>::isComplex) { - qCopy(m_begin + l, m_begin + m_size, m_begin + f); + std::copy(m_begin + l, m_begin + m_size, m_begin + f); T *i = m_begin + m_size; T *b = m_begin + m_size - n; while (i != b) { diff --git a/tests/benchmarks/corelib/tools/tools.pro b/tests/benchmarks/corelib/tools/tools.pro index ca9c0a6f89..b4ee0520a6 100644 --- a/tests/benchmarks/corelib/tools/tools.pro +++ b/tests/benchmarks/corelib/tools/tools.pro @@ -2,21 +2,12 @@ TEMPLATE = subdirs SUBDIRS = \ containers-associative \ containers-sequential \ - qbytearray \ qcontiguouscache \ qcryptographichash \ - qdatetime \ qlist \ - qlocale \ qmap \ qrect \ qringbuffer \ qstack \ - qstring \ - qstringbuilder \ - qstringlist \ - qtimezone \ qvector \ qalgorithms - -!*g++*: SUBDIRS -= qstring |