summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
Commit message (Collapse)AuthorAgeFilesLines
...
* Add basic benchmarks for QFutureSona Kurazyan2021-06-193-0/+332
| | | | | | | | | | The benchmark simply calls the non-trivial methods of QFuture, mostly to make sure that fixes in the parent patches don't have any performance implications. Task-number: QTBUG-92045 Change-Id: Ib4e8c314a70b3090a1af55f1b96d9dad4bc63861 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Implement QFileInfo::junctionTarget(), adjust auto-testKarsten Heimrich2021-06-051-5/+5
| | | | | | | | | | | | The change in 004e3e0dc2cab4a4534d2ed3ace41aad6bfbe45d introduces Windows junction awareness, though users were still unable to resolve the junction target. This change adds the ability to solve this. Fixes: QTBUG-93869 Change-Id: I9f4d4ed87b92e757f7b6d8739e2a61b58c096f63 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Refactor createSymbolicLink() and createNtfsJunction()Karsten Heimrich2021-06-021-3/+2
| | | | | | | | Both functions now return a result object. Eliminates the need to pass the errorMessage out-parameter. Adapt auto-tests. Change-Id: I110b68fedc67b01f76796c44fa55383b2cc03460 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QStringTokenizer: Add a benchmarkMårten Nordheim2021-05-194-0/+203
| | | | | | | | Mostly for testing QLatin1String::indexOf optimizations in the next patch but useful in general Change-Id: I85bf76f3e1d5abb994fd12907db2f2a723a8d330 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-182-88/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BASE argument of qt_add_resources now denotes the root point of the alias of the file. Before, BASE was merely prepended to every file that got passed to qt_add_resources. Old behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "images/button.png") Alias is "../shared/images/button.png", and pro2cmake generated QT_RESOURCE_ALIAS assignments to fix this. New behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "../shared/images/button.png") The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment is needed. The new behavior is in effect for user projects and for Qt repositories that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be ported one by one to this new behavior. Then the old code path can be removed. Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make loop variables references in date benchmarkDavid Skoland2021-04-271-5/+5
| | | | | | | | This more accurately simulates real-world usage. Change-Id: Ib1b49d165b3cfaef2bef51e958a1830cc7f8c285 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Declare loop arg in benchmark unusedDavid Skoland2021-04-271-2/+2
| | | | | | | | Since these tests do not actually use the filename in the loops, add macros to declare them unused. Change-Id: I3362e0478ac6802b37f54f90ca377aa462570d8c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix QMetaType API deprecation warning in benchmarkVolker Hilsheimer2021-04-261-1/+1
| | | | | | | Slipped through 1d3fe418e2cacba4cd75156ff94237d9f2461f07. Change-Id: I7ff39852a878ce76d48d5a1798a49f9137e00a13 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add QSortFilterProxyModel clear-filter benchmarkIgor Kushnir2021-04-254-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QBENCHMARK_ONCE rather than QBENCHMARK to avoid skewing the results: when the QBENCHMARK block is repeated multiple times after the setup code above runs once, only the first setFilterRegularExpression() call unfilters some rows, while the subsequent calls simply check that there is nothing to do. The added benchmark is sensitive to the inefficiency - quadratic rather than linear time complexity - fixed by 7d92ef63d7c2d9d017d89905a2ee0d1e9226b15c. The following two tables contain the benchmark results on my GNU/Linux system. The numbers denote milliseconds per iteration. 1. Qt 5.15.2 without the performance fix: 10K 25K 50K 100K 250K 500K no match 0 1 2 5 14 28 all 0 0 0 1 3 7 first 0 1 2 5 14 28 1000th 2 6 12 25 68 302 middle 3 34 132 518 3300 13665 1000th from end 1 4 9 19 50 103 last 0 1 2 5 14 30 each 10'000th 0 39 211 937 6326 41050 each 100'000th 0 1 2 5 4226 34780 Without the fix the benchmark times out and aborts at 1000K and 2000K data rows. 2. Qt 5.15.2 with the performance fix: 10K 25K 50K 100K 250K 500K 1000K 2000K no match 0 1 2 4 12 26 56 136 all 0 0 0 1 3 7 14 28 first 0 1 2 4 12 26 56 136 1000th 0 1 2 4 13 28 62 145 middle 0 1 2 4 13 27 59 142 1000th from end 0 1 2 4 13 28 60 145 last 0 1 2 4 13 27 59 141 each 10'000th 0 1 2 6 22 69 290 1413 each 100'000th 0 1 2 4 13 30 81 261 Change-Id: I419a5521dd0be7676fbb09b34b4069d4a76423b1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Update QList benchmark testsAndrei Golubev2021-04-211-101/+68
| | | | | | | | | | | | | | | | | | | Removed 5.15 specific QVector code, which is unlikely usable now when we are at 6.1+ timeline (that was really only a nice-to-have during 5.15 -> 6.0 transition) Added "remove first" benchmark to track the fast (or not so fast) removal path Updated mid insertion and mid emplace to actually trigger both paths (growing at the beginning and at the end), before it was really using just one side, which is not quite the "mid" way it feels. Also changed mid insertion to actually use the insert algorithm. Seems like insert(i, t) calls emplace under the hood at least from the visual introspection Change-Id: I01b82cfa0ae38d481ea7362947f3607d757bf5d0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge integration refs/builds/qtci/dev/1618512247Qt CI Bot2021-04-161-9/+1
|\
| * Remove Qt dependency from some test helper executablesJoerg Bornemann2021-04-151-9/+1
| | | | | | | | | | | | | | | | | | | | | | pro2cmake did not take into account the QT -= qt bit of the .pro files. Fixes: QTBUG-91676 Change-Id: If1373ee966312e4246490bd7389d75be9fa739cb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add the "Territory" enumerated type for QLocaleJiDe Zhang2021-04-151-14/+14
|/ | | | | | | | | | | | | | | | | | | The use of "Country" is misleading as some entries in the enumeration are not countries (eg, HongKong), for all that most are. The Unicode Consortium's Common Locale Data Repository (CLDR, from which QLocale's data is taken) calls these territories, so introduce territory-based names and prepare to deprecate the country-based ones in due course. [ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for its Country enumeration, and associated territory-based names to match its country-named methods, to better match the usage in relevant standards. The country-based names shall in due course be deprecated in favor of the territory-based names. Fixes: QTBUG-91686 Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace deprecated APIs in metatype/variant benchmarksVolker Hilsheimer2021-04-144-52/+49
| | | | | | | Fix compiler warnings. Change-Id: Id09b414f530a0d35c1a79e32112ff59185be2bc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix some warningsAndreas Buhr2021-03-298-14/+37
| | | | | Change-Id: I546300b4e630a2234c83c03ece65a08f4c8652d2 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix some warningsAndreas Buhr2021-03-252-3/+3
| | | | | Change-Id: I9460606cefd8c4b5c01e576043c1bc8660b19de4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_bench_qmetaobject: Fix testFabian Kosmale2021-03-191-3/+4
| | | | | | | | | | The code has apparently been broken for quite a while, probably since the change that made the QObject constructor invokable. Fixes: QTBUG-91710 Pick-to: 6.0 6.1 5.15 Change-Id: I8b7e6c8a579913b3d0e2a364ffdbffe8d404c72b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Convert QSslSocket(Backend)Private into pluginTimur Pocheptsov2021-03-171-3/+0
| | | | | | | | | | | | | | All backend-specific code is now separated and removed from QSslSocket(Private) code. The original code is mostly preserved to avoid (as much as possible) regressions (and to simplify code-review). Fixes: QTBUG-91173 Task-number: QTBUG-65922 Change-Id: I3ac4ba35d952162c8d6dc62d747cbd62dca0ef78 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 9391ba55149336c395b866b24dc9b844334d50da)
* tst_qguimetatype: Avoid deprecated methodsFabian Kosmale2021-03-171-14/+21
| | | | | | | | | | | This makes the 5.15 and 6.x branches more comparable, as in 6.0 the preferred way is to use the non-static methods (which avoids an expensive lookup in 6.x). As a drive-by, Avoid memory leaks if the test fails. Pick-to: 6.0 6.1 5.15 Change-Id: I95b133342a4ea19dd23c235a408f38089706412b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix warnings about marking functions overrideAndreas Buhr2021-03-109-79/+94
| | | | | Change-Id: I7737469d3016f9522e497b443edd864fa4d714cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_qguivariant benchmark: Only use valid QMetaTypesFabian Kosmale2021-03-101-2/+5
| | | | | | | | | Otherewise, we hit an assertion because the name is empty. Fixes: QTBUG-91709 Pick-to: 6.0 6.1 Change-Id: I03a530d64ea8dead3efc5fcb8c00909388a387d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_bench_qguimetatype: only consider valid metatypesFabian Kosmale2021-03-101-2/+5
| | | | | | | | | | Otherwise the benchmark crashes as the data tag for the row would be empty. Fixes: QTBUG-91708 Pick-to: 6.0 6.1 Change-Id: I484ded5b8670571b80012e64d67846d3b8db5320 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2Alex Trotsenko2021-03-023-0/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a foreign event loop that does not enter an alertable wait state is running (which is also the case when a native dialog window is modal), pipe handlers would freeze temporarily due to their APC callbacks not being invoked. We address this problem by moving the I/O callbacks to the Windows thread pool, and only posting completion events to the main loop from there. That makes the actual I/O completely independent from any main loop, while the signal delivery works also with foreign loops (because Qt event delivery uses Windows messages, which foreign loops typically handle correctly). As a nice side effect, performance (and in particular scalability) is improved. Several other approaches have been tried: 1) Using QWinEventNotifier was about a quarter slower and scaled much worse. Additionally, it also required a rather egregious hack to handle the (pathological) case of a single thread talking to both ends of a QLocalSocket synchronously. 2) Queuing APCs from the thread pool to the main thread and also posting wake-up events to its event loop, and handling I/O on the main thread; this performed roughly like this solution, but scaled half as well, and the separate wake-up path was still deemed hacky. 3) Only posting wake-up events to the main thread from the thread pool, and still handling I/O on the main thread; this still performed comparably to 2), and the pathological case was not handled at all. 4) Using this approach for reads and that of 3) for writes was slightly faster with big amounts of data, but scaled slightly worse, and the diverging implementations were deemed not desirable. Fixes: QTBUG-64443 Change-Id: I66443c3021d6ba98639a214c3e768be97d2cf14b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix some warnings about virtual/overrideAndreas Buhr2021-02-231-2/+2
| | | | | | | | | This patch marks some functions "override" to silence the corresponding warning. Change-Id: I88ccc5fa7521ecccc84a6cba9f06ea185cc5679e Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix compiler warning: initialize variableVolker Hilsheimer2021-02-111-2/+2
| | | | | | | The initialization happens outside the bechmarking loop. Change-Id: Id661fa2f995e964277a5c388b8fac13ff8687d92 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix QMetaType benchmarkFabian Kosmale2021-02-041-3/+5
| | | | | | | | The benchmark used to crash because QMetaType::typeName would return an empty string, which is not a legal value for newRow. Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compiler warning in QNetworkReply testVolker Hilsheimer2021-02-031-2/+2
| | | | | | | | Clang warning: 'isSequential' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] Change-Id: I1a7c5516d2656469eab556e7f9d310192510b99b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Optimize RGBA64->RGBA64PM for SSE2/AVX2Allan Sandfeld Jensen2021-02-031-0/+5
| | | | | | | | And remove the direct conversion so we can get both the SIMD optimization and threading applied. Change-Id: Id032ea91cc40c1cbf1c8a1da0386de35aa36cfb5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a few compiler warnings in testsAllan Sandfeld Jensen2021-02-026-32/+26
| | | | | Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove qmake project files for benchmarksJoerg Bornemann2021-02-01143-1049/+0
| | | | | | | | Also remove tests/tests.pro that would be empty without the benchmarks. Change-Id: Iaf92a729d1286b3e0c03bf9f877b59e1d83708e6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Import qproperty benchmarks from private repoMaximilian Goldstein2021-01-294-0/+323
| | | | | Change-Id: Icff5685b921f8a99acfeda1d79bb03ee652aa107 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QVariant benchmark: fix crashesFabian Kosmale2021-01-271-4/+7
| | | | | | | | | | - Skip unused metatype id - Do not construct a QVariant from an int, when we instead want to construct a QVariant for a given metatype (was: metatype id in Qt 5) Pick-to: 6.0 Change-Id: I1ac19dec5549b424a9429f69999eaf8e96c022e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add simple benchmark for QRegularExpressionIvan Solovev2021-01-206-1/+321
| | | | | | | | | | | | The benchmark simply calls QRegularExpression's public API methods, so that we can assess how changes to the implication impact performance. (Its addition is prompted by evaluation of whether adding a move constructor saves more or less than the resulting need for d-pointer null-checks costs.) Task-number: QTBUG-86634 Change-Id: Idef775ef6cf9f9ded3ce7ba5b85e460571d12756 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove unused variable from QNetworkReply benchmarkVolker Hilsheimer2021-01-191-1/+0
| | | | | | | | Fixes compiler warning. Change-Id: I73963f9f711b02d999b366dbf884acd5c851c950 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-124-57/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove QtDBus includesDavid Skoland2021-01-123-4/+8
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Pick-to: 6.0 Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-2236-36/+48
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-102-2/+2
| | | | | | | | | And fix up some wrong qmake project files Pick-to: 6.0 Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-302-3/+3
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix warnings about unused variables in benchmarksAndreas Buhr2020-11-303-3/+1
| | | | | | | | | This patch removes two unused variables and marks one unused, fixing three warnings. Change-Id: I71f59839452590b82ffb5459a968f06bd434fb9a Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-231-3/+2
| | | | | | | We can depend on C++14 now. Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "Allow QWindowsPipe{Reader,Writer} to work with foreign event loops"Kai Koehne2020-11-205-250/+0
| | | | | | | | | | | | | | This reverts commit ee122077b09430da54ca09750589b37326a22d85. Reason for revert: This causes QProcess::readAll() to sometimes return nothing after the process has ended. Fixes: QTBUG-88624 Change-Id: I34fa27ae7fb38cc7c3a1e8eb2fdae2a5775584c2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 23100ee61e33680d20f934dcbc96b57e8da29bf9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: fix QLocalSocket benchmark to use new qt_internal_ APIAlex Trotsenko2020-11-171-1/+1
| | | | | | | Amends ee122077b. Change-Id: I9b750eb88ac9c83da26da4e5921cb147716c5eb6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Allow QWindowsPipe{Reader,Writer} to work with foreign event loopsAlex Trotsenko2020-11-175-0/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a foreign event loop that does not enter an alertable wait state is running (which is also the case when a native dialog window is modal), pipe handlers would freeze temporarily due to their APC callbacks not being invoked. We address this problem by moving the I/O callbacks to the Windows thread pool, and only posting completion events to the main loop from there. That makes the actual I/O completely independent from any main loop, while the signal delivery works also with foreign loops (because Qt event delivery uses Windows messages, which foreign loops typically handle correctly). As a nice side effect, performance (and in particular scalability) is improved. Several other approaches have been tried: 1) Using QWinEventNotifier was about a quarter slower and scaled much worse. Additionally, it also required a rather egregious hack to handle the (pathological) case of a single thread talking to both ends of a QLocalSocket synchronously. 2) Queuing APCs from the thread pool to the main thread and also posting wake-up events to its event loop, and handling I/O on the main thread; this performed roughly like this solution , but scaled half as well, and the separate wake-up path was still deemed hacky. 3) Only posting wake-up events to the main thread from the thread pool, and still handling I/O on the main thread; this still performed comparably to 2), and the pathological case was not handled at all. 4) Using this approach for reads and that of 3) for writes was slightly faster with big amounts of data, but scaled slightly worse, and the diverging implementations were deemed not desirable. Fixes: QTBUG-64443 Change-Id: I1cd87c07db39f3b46a2683ce236d7eb67b5be549 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-152-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QWinEventNotifier: unlink from event dispatcherAlex Trotsenko2020-11-105-1/+165
| | | | | | | | | | | | | | | | | | | | | | | | Instead of multiplexing all notifications into a single Qt event for the event dispatcher, we can send 'WinEventAct' event directly for each notifier which activated. This trick improves the performance (esp. on a large number of events) and allows us to remove notifiers handling from the event dispatcher completely. As an alternative to sending Qt events, use of Windows' APC queue in conjunction with waking up the Qt event loop from within the Windows thread pool has been considered. However, that would lead to signal emission asynchronous to the Qt event loop's operation, which is not acceptable. Thanks to Oswald Buddenhagen for the proposed idea. [ChangeLog][QtCore][QAbstractEventDispatcher] The {un}registerEventNotifier() member functions have been removed. QWinEventNotifier is no longer needed to be registered in the event dispatcher. Change-Id: I140892fb909eaae0eabf2e07ebabcab78c43841c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix QArrayDataOps generic and relocatable emplace()Andrei Golubev2020-11-091-20/+80
| | | | | | | | | | | | | | | | | | Emplace() implemented with std::rotate is just awful on my system (Ubuntu 18.04 GCC 7.5.0). Custom code is much faster, so go for it. Cannot really use insert() code, which is also fast, because it doesn't forward-reference values but copies them always Changes in performance (approximately) for emplacing 100k elements into the middle: Complex 7600ms -> 1700ms Movable 7600ms -> 200ms Task-number: QTBUG-86583 Change-Id: If883c9b8498a89e757f3806aea11f8fd3aa3c709 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QList/QVector benchmark testsAndrei Golubev2020-11-041-1/+265
| | | | | | | | | | | | Added some simple benchmarks for QList insertion of 1 element Added same tests for QVector (within the same file) for 5.15 Task-number: QTBUG-87330 Task-number: QTBUG-86583 Pick-to: 5.15 Change-Id: I19a851c79cf5ce0329266883e99ecaf2d6b3df19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add constructor benchmarks for QLocale, to test likely sub-tag matchingEdward Welbourne2020-10-261-0/+317
| | | | | | Change-Id: Ib4c1d0ea031a581020c1f050fa4096d5196cc752 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add benchmark for QString::number(int)Andreas Buhr2020-10-231-0/+9
| | | | | | | | Add a almost trivial benchmark for QString::number(int). Change-Id: Ice67eaf28e8d7b235fd5ec5e0b87b3b9053ae61e Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>