summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Standardise layout and naming in corelib benchmarksEdward Welbourne2021-08-301-259/+0
| | | | | | | | | | | | | | | Make file names match CMake's test names (and those follow dir-name) and class names follow tst_ClassName pattern when testing ClassName. Purge comments about the qmake configs the CMakeLists.txt are generated from. Purge empty constructors and init/cleanup methods of classes. Fix petty coding style violations. Add qdir/tree/, qurl, qbench and qset benchmarks to their parent directories' lists of subdirs. Fix unused return error from qurl benchmark. Change-Id: Ifc15a3a46e71cf82ad0637753517e0df34049763 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | 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>
* 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>
* Refactor QMutexLocker to be able to handle recursive mutexesLars Knoll2020-10-171-3/+3
| | | | | | | | Since we're going to split QMutex and QRecursiveMutex into separate classes, make sure QMutexLocker is prepared for that. Change-Id: Id5e9a955d1db7c8ee663dd3811ad6448dad0aeae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-101-1/+1
| | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QReadWriteLock: add a check for writeOnly, tooMarc Mutz2019-09-121-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | Results on my machine: PASS : tst_QReadWriteLock::writeOnly(QMutex) RESULT : tst_QReadWriteLock::writeOnly():QMutex: 3,607 msecs per iteration (total: 3,607, iterations: 1) PASS : tst_QReadWriteLock::writeOnly(QReadWriteLock) RESULT : tst_QReadWriteLock::writeOnly():QReadWriteLock: 39,703 msecs per iteration (total: 39,703, iterations: 1) PASS : tst_QReadWriteLock::writeOnly(std::mutex) RESULT : tst_QReadWriteLock::writeOnly():std::mutex: 3,697 msecs per iteration (total: 3,697, iterations: 1) PASS : tst_QReadWriteLock::writeOnly(std::shared_mutex) RESULT : tst_QReadWriteLock::writeOnly():std::shared_mutex: 5,727 msecs per iteration (total: 5,727, iterations: 1) PASS : tst_QReadWriteLock::writeOnly(std::shared_timed_mutex) RESULT : tst_QReadWriteLock::writeOnly():std::shared_timed_mutex: 5,921 msecs per iteration (total: 5,921, iterations: 1) (the 'nothing' test of course doesn't work with writing, as writing to the same QString from different threads is UB) Change-Id: Ia78b54963a51eaf6563ce0d243316a3337056a83 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Brush up QReadWriteLock benchmarkMarc Mutz2019-09-121-7/+21
| | | | | | | | | - add override - tests C++17 shared_mutex in addition to C++14 shared_timed_mutex - replace manual memory management with unique_ptr Change-Id: If52df2097a4b92c10df4a7cdbb1c506d64b673e3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tests: Unify license to GPL-EXCEPTKai Koehne2017-04-031-1/+1
| | | | | | Change-Id: Ic718650a8a7bddd4ee28c5650a3f5baf70886e51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Add a benchmark for QReadWriteLockOlivier Goffart2016-08-101-0/+183
Results on current dev branch [955b2bdfc0cb1d707f8914be230e5e00c548b6ab]: thread count: 4 ********* Start testing of tst_QReadWriteLock ********* Config: Using QtTest library 5.8.0, Qt 5.8.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 6.1.1 20160707) PASS : tst_QReadWriteLock::initTestCase() PASS : tst_QReadWriteLock::uncontended(nothing) RESULT : tst_QReadWriteLock::uncontended():"nothing": 1,113,292.1 CPU ticks per iteration (total: 11,132,922, iterations: 10) PASS : tst_QReadWriteLock::uncontended(QMutex) RESULT : tst_QReadWriteLock::uncontended():"QMutex": 35,490,310.7 CPU ticks per iteration (total: 354,903,108, iterations: 10) PASS : tst_QReadWriteLock::uncontended(QReadWriteLock, read) RESULT : tst_QReadWriteLock::uncontended():"QReadWriteLock, read": 40,513,695.0 CPU ticks per iteration (total: 405,136,950, iterations: 10) PASS : tst_QReadWriteLock::uncontended(QReadWriteLock, write) RESULT : tst_QReadWriteLock::uncontended():"QReadWriteLock, write": 43,179,327.2 CPU ticks per iteration (total: 431,793,272, iterations: 10) PASS : tst_QReadWriteLock::uncontended(std::mutex) RESULT : tst_QReadWriteLock::uncontended():"std::mutex": 37,733,243.0 CPU ticks per iteration (total: 377,332,430, iterations: 10) PASS : tst_QReadWriteLock::uncontended(std::shared_timed_mutex, read) RESULT : tst_QReadWriteLock::uncontended():"std::shared_timed_mutex, read": 71,517,438.7 CPU ticks per iteration (total: 715,174,388, iterations: 10) PASS : tst_QReadWriteLock::uncontended(std::shared_timed_mutex, write) RESULT : tst_QReadWriteLock::uncontended():"std::shared_timed_mutex, write": 69,967,867.5 CPU ticks per iteration (total: 699,678,676, iterations: 10) PASS : tst_QReadWriteLock::readOnly(nothing) RESULT : tst_QReadWriteLock::readOnly():"nothing": 479,393,335.3 CPU ticks per iteration (total: 4,793,933,354, iterations: 10) PASS : tst_QReadWriteLock::readOnly(QMutex) RESULT : tst_QReadWriteLock::readOnly():"QMutex": 823,493,383.2 CPU ticks per iteration (total: 8,234,933,832, iterations: 10) PASS : tst_QReadWriteLock::readOnly(QReadWriteLock) RESULT : tst_QReadWriteLock::readOnly():"QReadWriteLock": 559,816,053.6 CPU ticks per iteration (total: 5,598,160,536, iterations: 10) PASS : tst_QReadWriteLock::readOnly(std::mutex) RESULT : tst_QReadWriteLock::readOnly():"std::mutex": 961,903,416.3 CPU ticks per iteration (total: 9,619,034,164, iterations: 10) PASS : tst_QReadWriteLock::readOnly(std::shared_timed_mutex) RESULT : tst_QReadWriteLock::readOnly():"std::shared_timed_mutex": 1,786,254,363.5 CPU ticks per iteration (total: 17,862,543,636, iterations: 10) PASS : tst_QReadWriteLock::cleanupTestCase() Totals: 14 passed, 0 failed, 0 skipped, 0 blacklisted, 44507ms ********* Finished testing of tst_QReadWriteLock ********* Change-Id: I42189f7a356dcb36378e9d54111b7fbe89e62402 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>