summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/sql
Commit message (Collapse)AuthorAgeFilesLines
* psql: do not try to get table name when PQftable returns InvalidOidChristian Ehrlicher2018-02-221-0/+33
| | | | | | | | | | | When the table for a selected column can't be determined (e.g. because there is no table for it), PQftable returns InvalidOid. This was not covered and a query to determine the table name was executed every time which slowed down calls to QSqlQuery::value(QString). Task-number: QTBUG-65226 Change-Id: Idd8fbaaef7b01ca4151439f46cad2cce6f1c93e9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* psql: Improve performance of record()v5.10.1Andy Shaw2018-02-083-0/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to save having to always run a query to get the tablename for a known oid then we cache the result on the driver side. The oid stays the same while the table exists, so only on dropping it would it change. Recreating the table causes it to get a new oid, so there is no risk of the old one being associated with the wrong table when this happens, if the driver is still open at that point. The benchmark added shows the improvement from the previous code, before the results for PostgreSQL was: RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost": 259 msecs per iteration (total: 259, iterations: 1) whereas now it is: RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost": 0.000014 msecs per iteration (total: 59, iterations: 4194304) Task-number: QTBUG-65226 Change-Id: Ic290cff719102743da84e2044cd23e540f20c96c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Robert Szefner <robertsz27@interia.pl> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove QMAKE_LIBS_NETWORK from QSqlQuery benchmarkJoerg Bornemann2017-08-281-1/+0
| | | | | | | This was added in c6612de3 for WEC7 which we do not support anymore. Change-Id: I329374bb8375d629a6f7619236371c0fc953792d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Tests: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-011-1/+0
| | | | | Change-Id: I1955320e7639760b4383a53f37a506c8055933ef Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Remove temporary string allocations when reading prepared statement.Milian Wolff2015-08-131-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, we use the binary MySQL encoding and copy the data directly into the QVariant of the desired type. This gets rid of the temporary string allocations and greatly improves the performance of the added benchmark. On my machine, the results are: Before: 0.562 msecs per iteration (total: 563, iterations: 1000) 1,922,479.330 instructions per iteration (total: 1,922,479,330, iterations: 1000) After: 0.381 msecs per iteration (total: 381, iterations: 1000) 774,132.957 instructions per iteration (total: 774,132,958, iterations: 1000) Note that the same could be applied to floating point data types in the future. Additionally, special support for MYSQL_TIME structure coult be added to get rid of the string conversions there. To ensure everything keeps working, a new auto test is added as well that verifies the select statements and insertions of integral data into a MySql table works as intended. [ChangeLog][QtSql] Improve performance when reading integer values from MySQL databases via prepared statements. Change-Id: I21dd9277661971ded934546f09535014b63f8eb8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Adjust DBMSType to DbmsType to follow conventionsAlejandro Exojo2014-11-261-3/+3
| | | | | | | | | The enum was made public in f84b00c6d26eb7a3a6802210d2a8b12ddbf815aa, but this makes it follow the convention to camel case acronyms too before it's too late to change it. Change-Id: Ibb81e9221cb73fe0502d0a26f2d73512dd142f08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Expose QSqlDriverPrivate dbmsType in public QSqlDriver apiMatt Broadstone2014-09-241-14/+14
| | | | | | | | | | dbmsType was previously kept as a private variable in QSqlDriverPrivate, however it's particularly useful for QODBC users. [ChangeLog][QtSql][QSqlDriver] Add support for determining DBMS type from SQL driver. Change-Id: If1c221520da9ac4ccef85a02db078679d76eac92 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Cleanup the SQL testsAndy Shaw2013-04-251-15/+17
| | | | | | | | | | This removes some XFAILS that were no longer correct and fixes some existing problems in the tests where ODBC is concerned. Change-Id: I91de526bb50ad4046ba07ddb5336aa3714966687 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Fix qsqlquery benchmark test build for WEC7.Janne Anttila2013-04-171-1/+1
| | | | | | | | | | | WEC7 does not have ws2_32 lib. The lib is needed for gethostname symbol, instead of using hard coded platform specific libs, rely on QMAKE_NETWORK_LIBS variable containing network libs. Change-Id: Ice39ca3f2d176cc5df88beded4b64d2b92f4f3ba Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
* Fix sql tests in respect to Oracle databasesAndy Shaw2013-04-051-40/+40
| | | | | | | | | | Oracle has a limitation of 30 characters for a tablename so the main change is to account for this, which meant changing all the usages of qTableName(). Some other fixes are included that ensure the tests are working correctly as far as Oracle is concerned. Change-Id: I8ad8a5a33e6a70fcad235f6a7e82e91687b74fee Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Move the dbmstype to QSqlDriverPrivate so it can be used for all driversAndy Shaw2013-04-021-1/+1
| | | | | | | | | By moving it to QSqlDriverPrivate we make it easier to check what database is actually connected which is particularly useful for the autotests. Change-Id: I54d1c2c998919c1d54efb1b6ac9303070ece54aa Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove capitalization when specifying include-libraries.kb2012-05-141-1/+1
| | | | | | | | | | | | | MinGW installations on case-sensitive filesystems expect lowercase names of include-libraries and (usually) include files. When crosscompiling on Debian 6 (targeting MS Windows) linking fails because mingw is looking for non-existent include-libraries. Using lowercase names solves this. Change-Id: Id3454f4ed8ba42b6ea93d65d9c0ce567db6712df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | 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>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix compilation of some benchmark tests on Windows.Friedemann Kleint2011-11-291-0/+1
| | | | | Change-Id: Iab6b83f3d4693a3b5deaaf88043dde75a84866fd Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* benchmarks: eliminated usage of qttest_p4.prfRohan McGovern2011-10-251-3/+0
| | | | | | | | | 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>
* test: Leftover for split `qsqlquery' unit and benchmark testSergio Ahumada2011-10-252-0/+6
| | | | | | | | | Add new directory structure to benchmarks.pro file introduced by 3172631f0d40f34249f376f9b94a40919573d0c7 . Task-number: QTQAINFRA-353 Change-Id: I998530cd00bb1849f7a42816d61195f6a5bb4b92 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* test: Split `qsqlquery' unit and benchmark testSergio Ahumada2011-10-232-0/+281
Moving benchmark test from 'tests/auto' to 'tests/benchmarks'. Also removing 'qttest_p4' usage while we are at it. - void benchmark(); was moved to 'tests/benchmarks/sql/kernel/qsqlquery' Task-number: QTQAINFRA-353 Change-Id: I241bb1a2fba1c1b5524c21e5941a6c5daf5a4a89 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>