summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* Implement QVector with QArrayData interface.Jędrzej Nowacki2012-05-303-1/+60
| | | | | Change-Id: I109f46892aed2f6024459812d24922b12358814d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QChar: add isSurrogate() and isNonCharacter() to the public APIKonstantin Ritt2012-05-161-19/+6
| | | | | | | | + QChar::LastValidCodePoint enum value that supercede the UNICODE_LAST_CODEPOINT macro replace uses of hardcoded values with the new API; remove leftovers Change-Id: I1395c9840b85fcb6b08e241b131794a98773c952 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-161-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
| * replace hardcoded values with a surrogate handling methodsKonstantin Ritt2012-04-131-3/+3
| | | | | | | | | | | | Change-Id: Ib41e08d835f2e8ca2e32b4025c6f5a99840f2e27 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * fix QUtf8 codec to disallow codes in range [U+fdd0..U+fdef]Konstantin Ritt2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | 0xfdef-0xfdd0 is definitely 31 and not 15 :) also fix all copy-pastes of this code (greping for '0xfdd0' helps ;) Change-Id: I8f3bd4fd9d85f9de066f0f5df378b9188c12bd48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* | Deprecate qMemCopy/qMemSet in favour of their stdlib equivilents.Robin Burchell2012-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just like qMalloc/qRealloc/qFree, there is absolutely no reason to wrap these functions just to avoid an include, except to pay for it with worse runtime performance. On OS X, on byte sizes from 50 up to 1000, calling memset directly is 28-15% faster(!) than adding an additional call to qMemSet. The advantage on sizes above that is unmeasurable. For qMemCopy, the benefits are a little more modest: 16-7%. Change-Id: I98aa92bb765aea0448e3f20af42a039b369af0b3 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Remove references to QT_NO_STL from QtCoreThiago Macieira2012-04-072-8/+0
| | | | | | | | | | | | | | | | QT_NO_STL is now no longer defined, so remove the conditionals and select the STL side. Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* | Rewrite QMap to use a RB treeLars Knoll2012-03-233-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMap used to use a skiplist in Qt 4.x, which has variable sized nodes and we can thus not optimise using custom allocators. The rewrite now uses a red-black tree, and all allocations and tree operations happen in the cpp file. This will allow us to introduce custom allocation schemes in later versions of Qt. Added some more tests and a benchmark. Memory consumption of the new QMap implementation is pretty much the same as before. Performance of insertion and lookup has increased by 10-30%. iteration is slower, but still extremely fast and should not matter compared to the work usually done when iterating. Change-Id: I8796c0e4b207d01111e2ead7ae55afb464dd88f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge master into api_changesKent Hansen2012-03-195-9/+7
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
| * Fixed benchmarks to work from install directoryKurt Korbatits2012-03-195-9/+7
| | | | | | | | | | | | | | | | | | - Changed benchmarks to use TESTDATA and QFINDTESTDATA - Fixed up targets all use tst_bench_ syntax Change-Id: I5c2936702e248478f5df225ce38893158ee22d7f Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Merge remote-tracking branch 'origin/api_changes' into containtersJoão Abecasis2012-03-085-98/+87
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetaobject.cpp src/corelib/kernel/qvariant.cpp src/tools/moc/moc.h Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
| * Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-042-12/+12
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| | * Make some tests and benchmarks pass with QT_NO_QSTRINGBUILDERStephen Kelly2012-03-012-12/+12
| | | | | | | | | | | | | | | Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * | Remove qhash_faster.Robin Burchell2012-02-293-73/+0
| | | | | | | | | | | | | | | | | | | | | | | | It's not faster under _any_ metric than the new algorithm, and it loses a lot of spread which is a bad thing. Change-Id: Ic87258f1c887822ffea1cb1517355564fabc3c26 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * | Copy Qt 4's QString hash algorithm.Robin Burchell2012-02-293-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We must do this the same way we do all other hash algorithms for fair comparison, as otherwise, the call to the PLT unfairly penalises QHash<QString>'s results, as it's in a different shared object. Change-Id: I69c891f5a97dcccdfcfbdbf32796f86242a42963 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Move data generation to initTestCase() method and store the results.Robin Burchell2012-02-291-72/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per the comments on Ie4100a1ca4dbe7bf1cd73de883a9854377ac2f5e, having Q_ASSERT was not a good idea, and data functions can't really handle QVERIFY/QCOMPARE/etc, so do this in initTestCase instead. Change-Id: I19e61dec7fe415bb1fa0f53a2920d99b8c7c8ea7 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * | Add test data for string forms of numbers.Robin Burchell2012-02-291-0/+12
| | | | | | | | | | | | | | | | | | | | | Similar to the UUID benchmark, but won't have any non-numerical characters. Change-Id: I7487c97cab96fd53c180fe12061e7be3ca96e883 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * | Add a test using lots of similar strings.Robin Burchell2012-02-291-0/+36
| |/ | | | | | | | | | | | | | | This attempts to emulate a dictionary usecase of sorts, done in code to avoid bloating the git repository by adding an actual word list. Change-Id: I878bc4af8877ba780ee699932f240c0d9c8ff12c Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-02-295-21/+5
|\| | | | | | | Change-Id: I97ba222435ff50a9e5422e6f2c73e4bb8d1b865c
| * clean up qmake-generated projectsOswald Buddenhagen2012-02-245-21/+5
| | | | | | | | | | | | | | | | remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Change QVector's in-memory data layoutJoão Abecasis2012-02-221-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new layout matches that of QByteArrayData and QStringData, except for offset which is measured from the beginning of QVectorData, whereas in those classes it (still?) references the end of the header data. The new layout uses an extra member for storing an offset into the data, which will allow introducing QVector::fromRawData, similar to the same functionality already existing in QString and QByteArray. By not using an actual array to index array members, we also steer clear of GCC bug #43247: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247 Change-Id: I408915aacadf616b4633bbbf5cae1fc19e415087 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-02-212-7/+31
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.h Change-Id: I03b1f3e05c9b7a45130887c522fcd9b7aa387129
| * Add a testcase of a list of UUIDs in string form.Robin Burchell2012-02-141-6/+30
| | | | | | | | | | | | | | | | | | | | UUIDs are a good testcase, because the textual content is all fairly similar. This also changes data generation to be a little neater now that we're starting to get multiple pieces of data. Change-Id: Ie4100a1ca4dbe7bf1cd73de883a9854377ac2f5e Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * Replace Q_WS_WINCE against Q_OS_WINCE.Andreas Holzammer2012-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | Window system Macros where deprecated so use Q_OS_WINCE for now. This code will need some refactoring, but this is the first step to it. Change-Id: I5876b80ee45d4b38ac63fc7d51e775dc70bbd485 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* | Have QVectorData::grow, take size of header w/ paddingJoão Abecasis2012-02-201-26/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes padding necessary to align the data array, but excludes the first element as was done before. Size of header is the interesting piece of information, anyway. This simplifies calculations in a couple of places, harmonizes code with the QRawVector fork and paves the way for further changes in QVector, namely the memory layout. When Q_ALIGNOF is not available, default to pointer-size alignment. This should be honoured by malloc and won't trigger use of more expensive aligned allocation. Change-Id: I504022ac7595f69089cafd96e47a91b874d5771e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVector: always grow exponentiallyJoão Abecasis2012-02-171-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For non-movable types (QTypeInfo<T>::isStatic), QVector would grow the array linearly, and defer to qAllocMore otherwise. That property, however, gives no indication as to how the vector will grow. By forcing additional allocations for growing containers of such types, this penalized exactly those objects which are more expensive to move. We now let qAllocMore reign in growth decisions. Change-Id: I843a89dcdc21d09868c6b62a846a7e1e4548e399 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-02-0526-91/+269
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I23d214bf33c2badfae1876da3cc7d6d8f6e635fb
| * tests: do not run benchmarks by default in 'make check'Sergio Ahumada2012-02-021-1/+0
| | | | | | | | | | | | | | | | | | `make check' is intended primarily for running functional tests. For the most part, it does not make sense to run benchmarks in the same test environment as the functional tests. Change-Id: I79f867fdab295bdbd4c4b3c785dfd7ede520022e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * Allow function types to be registered without workaroundsJoão Abecasis2012-01-311-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4b8ceb41aed352f10d36db5284453f425dbc5f3f added the requirement that pointed-to types need to be registered when registering pointer types. Unfortunately, the implementation also affects function pointer types. This change whitelists 0, 1, 2 and 3 argument functions as not deriving from QObject, forgoing the need to workaround details of the type registration implementation when registering those function pointer types. Change-Id: I4d855e9d70a8179a6e31b84623ad5bf063e0d6d8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| * Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3021-20/+21
| | | | | | | | | | | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * QHash benchmark: improve Java's hashGiuseppe D'Angelo2012-01-271-0/+11
| | | | | | | | | | | | | | | | Added a bit of documentation to the Java-like hashing function. Change-Id: I3f44eee305d91b76f0f89cd1acf21f6430b9482b Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * QHash benchmark: remove unused variablesGiuseppe D'Angelo2012-01-271-3/+0
| | | | | | | | | | | | Change-Id: Ib5abc171fb8fb70e2f73ac92ca22dc09146d8a55 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | | | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * Store the is-a QObject fact with the metatype declaration.Stephen Kelly2012-01-241-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a source incompatible change for Q_DECLARE_METATYPE(T*), which now requires T to be fully defined. The consequences of this are: * Forward declared types can no longer be declared as a metatype. (though this is a very uncommon thing to do). There is a trivial workaround where necessary. Change-Id: Id74c40088b8c0b466fcd7c55abd616f69acc82c8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * Add the capability to use multiple data sources for qhash benchmark.Robin Burchell2012-01-242-20/+31
| | | | | | | | | | | | | | More data sources to be added in followup commits. Change-Id: I0393119b36ac5d88fc2c5c8d46b000d13d5ca996 Reviewed-by: Richard J. Moore <rich@kde.org>
| * Remove executive summary.Robin Burchell2012-01-241-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | It isn't necessarily that hashing the whole string is the main problem, as the recently added java string benchmark appears to show, which means the original purpose of this benchmark is rather voided. This removal allows gradually repurposing the test towards providing general benchmarks of QHash performance. Change-Id: Iaab0a3b493387dcce99240632342235ed9c44d88 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * Move test files around.Robin Burchell2012-01-244-4/+4
| | | | | | | | | | | | | | | | | | main.cpp is easier for my muscle memory to remember than qhash_string as it is used by a number of other tests. Change-Id: I044f995d55a4ff1328dde0ae27b6e36a80114c38 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * Update contact information in license headers.Jason McDonald2012-01-2320-20/+20
| | | | | | | | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * Introduce a qalgorithms benchmark.Robin Burchell2012-01-214-1/+147
| | | | | | | | | | | | | | | | Based on the unit test for data production. Change-Id: I88a411c0079b251d3682c3fbf9fe7ed1b5457a7e Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org> Reviewed-by: Richard J. Moore <rich@kde.org>
| * Add a string hash implementation similar to the one in Java.Robin Burchell2012-01-203-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a similar runtime to the approach of sampling part of the string, with the benefit that it doesn't reduce the sampling to subsections of the string. Ironically, Java used to only sample parts of the string as well, but found that it produced too many collisions with certain string types, so they moved to use this method. RESULT : tst_QHash::qhash_qt4(): 0.0537 msecs per iteration (total: 110, iterations: 2048) PASS : tst_QHash::qhash_qt4() RESULT : tst_QHash::qhash_faster(): 0.015 msecs per iteration (total: 62, iterations: 4096) PASS : tst_QHash::qhash_faster() RESULT : tst_QHash::javaString(): 0.016 msecs per iteration (total: 66, iterations: 4096) Change-Id: Icb5da341ab6445163f4217650a0bdb3903e50210 Reviewed-by: hjk <qthjk@ovi.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-01-1621-23/+113
|\| | | | | | | Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355
| * Remove execute permission from files that don't need it.Jason McDonald2012-01-101-0/+0
| | | | | | | | | | Change-Id: Ib92875289cdd9831f35301c566fb567acc725bb6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
| * Remove the Q_TYPENAME define.Stephen Kelly2012-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | It is mostly not used (most places in Qt use typename directly), so is already not very useful. For example typename is used in: QDataStream& operator<<(QDataStream& s, const QVector<T>& v) Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
| * Update copyright year in license headers.Jason McDonald2012-01-0520-20/+20
| | | | | | | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * add tests and benchmarks for QString::toLower()/toUpper()/toCaseFolded()Konstantin Ritt2011-12-251-1/+91
| | | | | | | | | | | | | | | | | | Merge-request: 70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Change-Id: I3929d4d8963c3cef6d2c6420d8ad1f7a45f7e042 Reviewed-by: Olivier Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Use RefCount::setSharable feature in QVectorJoão Abecasis2012-01-101-1/+0
| | | | | | | | | | | | | | Note: This constitutes a break in Binary Compatibility. Change-Id: I050587901725b701f20dd46475ae48aec28aa54d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | Get rid of assignment operators in RefCountJoão Abecasis2012-01-041-1/+1
|/ | | | | | | | | | | | , and make it strictly a POD struct. Since this operator was only being used to set the initial (owned) value of the reference count, the name of the function introduced here to replace it makes that use case explicit. Change-Id: I2feadd2ac35dcb75ca211471baf5044a5f57cd62 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation of Benchmark tests on Windows.Friedemann Kleint2011-12-011-0/+2
| | | | | | Change-Id: I92186f916792d110f22b23525b673ef006e19046 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Compile with non-C++11 compilersBradley T. Hughes2011-11-141-14/+20
| | | | | | | | | | | Function pointers used as template parameters must have external linkage according to the C++ standard. The _mm_lddqu_si128() and _mm_load_si128() intrinsic functions are declared static in most implementations, which means we need to wrap them in a non-static function call to be used. Change-Id: I4e316851df890d77999649d47654f7f9a35d4080 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* benchmarks: eliminated usage of qttest_p4.prfRohan McGovern2011-10-2512-72/+12
| | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Change-Id: I48ab0ee64d8348cada2e6c7b27c67b6bbc36280d Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>