Calling qMin often prevents effective vectorization, and it is only
necessary when converting from formats with mixed color-channel widths.
Change-Id: I2a0f3f3fb528d45be1fd025758f9d915ee1736c0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Using shuffle and align storing our quint24 format can be done much
faster. This in particular improves conversions to RGB888.
Change-Id: I179748706a33a43fd6f60f5c40287317418c8867
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
I wrote a script to help find the files, but I reviewed the
contributions manually to be sure I wasn't claiming copyright for search
& replace, adding Q_DECL_NOTHROW or adding "We mean it" headers.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>
The file exists but it isn't listed in TESTDATA. This is only a problem
when the target is a another system as is the case with Qt for QNX.
Tests fail because the file isn't deployed.
Noticed this while testing the changes for custom spacing of JSON
output.
Task-number: QTBUG-47437
Change-Id: I098c34d2ab9027956d9233b24f30b5192ecfe96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Use character literals where applicable.
Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Fix usage of API that is marked deprecated.
Change-Id: Ib9a45e93084fb5b0d0d3aefd64b755dff7c696d6
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
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>
Otherwise you cannot link it statically against QtCore.
Change-Id: I4ac35602cea2192974f3e96ecad35edac976ce27
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QTextLayout::additionalFormats setters and getters using QList<FormatRange> have
been deprecated; port to the QVector versions.
Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp
to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find
it otherwise.
Change-Id: Ibab6589df057f02377d895079b56395859e3401e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Completes the inplace converters so that we can rely on inplace
conversions to succede as long as the image depth is the same.
Change-Id: Ia1ae34b5de1bc16e87ff5403bdacfcae44a22791
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Cleaning up smoothscale code. Upscaling is improved using existing
optimized interpolation methods, and downscale is given SSE4.1
optimized versions.
Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
According to I/O API, QIODevice and its inherited classes should be
able to process a full 64-bit offsets and lengths. This requires
64-bit parameters in operations with internal buffers. Rework
QRingBuffer to avoid implicit truncation of numbers and fix some
64-bit issues in code.
Change-Id: Iadd6fd5fefd2d64e6c084e2feebb4dc2d6df66de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Improves the conversion from RGB888 to RGB32 on platforms without SIMD
versions. This includes the fallback used on non-neon ARM devices.
Besides image conversion the routine is also used for decoding JPEG.
On x86 this version is within 0.7x of the speed of the SSSE3 version.
Change-Id: Id131994d7c3c4f879d89e80f9d6c435bb5535ed7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
There are many direct QImage conversions that doesn't need to be direct
but only are because they are faster than the generic conversion. This
patch optimizes the generic conversions and then removes all the direct
conversions that are now no faster than the generic.
Change-Id: I3dc5f44cc7f6358fd66420e9974eebaf2c7ca59c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
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>
The autovectorized versions of premultiplying conversions are almost
twice as fast with SSE4.1 as with SSE2. Therefore this patch lets
compilers that can make those versions convenient without duplicating
code do that and lets us use them when available.
Change-Id: I699035963abe55a38b9ef8ba7b4a8c961c8dfcdd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.
In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.
Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
With auto-vectorization enabled in QtGui, the 32bit version of
qPremultiply is faster than the 64bit version since it can be vectorized
wider (4x on 128bit as opposed to 2x). Since all our important 64bit
targets have SIMD, that makes the 64bit version pointless.
Change-Id: I4e9070a3a3c8e2b54f17a95ba0aee0405cbb8ec9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The class hasn't been used for a while anymore. Since it's
private, simply remove it from QtGui.
Change-Id: Ia0911d1c8b8836d963a51c8e354c96bc1ee4093f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
There's a change in Qt 5.4.0 that makes Qt compile with its own set of
D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't
compile or link if we're using the actual libdbus-1 API to build the
test.
This commit makes these unit tests use the same dynamic loading
mechanism.
Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This covers the only real additions over QVector: push and pop. Really, there
isn't too much specific to benchmark here, but we're interested in one specific
case: that of pushing and popping a single item repeatedly.
With the current QVector behavior, this causes constant deallocation, which
makes it morbidly slow. This behavior will be reviewed in a subsequent commit.
Results (not that anyone really cares) for me:
PASS : tst_QStack::qstack_push()
RESULT : tst_QStack::qstack_push():
1.9 msecs per iteration (total: 61, iterations: 32)
PASS : tst_QStack::qstack_pop()
RESULT : tst_QStack::qstack_pop():
8.2 msecs per iteration (total: 66, iterations: 8)
PASS : tst_QStack::qstack_pushpopone()
RESULT : tst_QStack::qstack_pushpopone():
80 msecs per iteration (total: 80, iterations: 1)
Change-Id: I3530888abbfcfcef39318d6be6d5b07306a4704e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Wait for the subprocess to print "ready" before assuming that it is
ready to receive calls. waitForStarted() will return as soon as the
child is running, but it may not have registered on D-Bus yet.
This also solves the synchronization problem more elegantly than how
tst_qdbusmarshall.cpp was trying to do it.
Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The executables are not in the same dir as on Unix, so we need to use
QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from
placing the executables in a "debug/" subdir.
Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
No need to loop twice to add the "native" entries, since they are added
by the helper function anyway.
Change-Id: I9caabc6fc4973a90b483840815769b1351947a89
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The enum was made public in f84b00c6d2, 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>
QMetaType::type(const char *) requires that the string argument is
0-terminated. This new overload makes it possible to query the type
of a string with an explicit length.
In particular, QByteArrays constructed by QByteArray::fromRawData(),
for example from a substring of a normalized method signature (the
"int" part of "mySlot(int"), can now be queried without making a copy
of the string.
Also, Qt5 meta-objects represent type names as QByteArray literals,
which can be fed directly to this new QMetaType::type() overload (no
need to call strlen).
Change-Id: I60d35aa6bdc0f77e0997f98b0e30e12fd3d5e100
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
Avoids allocating a QString for every char being written out.
The benchmark went from 5.5 ms per iteration to 0.8 ms,
and from 40 million instructions to 6 million.
Found using Milian Wolff's heaptrack tool.
Change-Id: I1784c47b944454bc947a607a22c39d249372ed55
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Do a check first if we need to transform before doing the transform.
This means we won't detach when transforming data that is already
correct.
And instead of using QChar, use our own hand-rolled table. In a proper
LTO build, the QChar calls would be resolved to a lookup of the Unicode
data, but not many people do LTO builds, Therefore, this means a great
speed-up is achieved by simply avoiding the function call. The extra
gain in performance comes from the simpler translation table instead of
the more complex full-Unicode data.
Also as a consequence, this changes the handling of two characters in
Latin 1: 'ß' should be uppercased to "SS" but we won't do it, and 'ÿ'
can't be uppercased in Latin 1 ('Ÿ' is outside the range).
Benchmarking is included. Comparing the Qt 5.4 algorithm to the new code
is almost 20x faster. Other alternatives are included in the benchmark
and are all faster than the current code, though slower than the new
one. While all of them could compress the tables to be smaller or shared
between uppercasing and lowercasing, they would also expand to more code
(though probably less than the extra bytes required in the full
translation table). In the trade-off, I decided to go with simplicity
and most efficient code.
Change-Id: I002d98318d236de0d27ffbea39d662cbed359985
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The comparison, Latin 1 and UTF-8 benchmarks contained in this file are
stale. The implementation changed in Qt 5.3 and this benchmark couldn't
be updated (test data too large for Qt).
Please contact Thiago Macieira to obtain the benchmarks and test data.
Change-Id: I48c19b1f1711eb73c953a30ed4da510e97a62472
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
clang warning: adding 'int' to a string does not append to the string
Change-Id: I6dc393269a52e9482fde106c17132336cf5ce226
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Cost of a type lookup for core built-in types is really small, just few
cpu instructions, but the benchmark was testing create() and destroy()
functions (in a different fashion) which by definition allocate and
de-allocate memory. These memory operations are significantly more
expensive which obfuscate the results.
Change-Id: I33c679f57e6c2b57e98328f076dfe249ab7bcde8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The "rbit" instruction requires ARMv6T2 or higher. This was found in the
CI when building the imx6 target:
Compiler: arm-poky-linux-gnueabi-g++
Flags: -mfloat-abi=hard -mfpu=neon
Errors from the assembler:
{standard input}:3078: Error: selected processor does not support ARM mode `rbit r3,r3'
{standard input}:7341: Error: selected processor does not support ARM mode `rbit ip,ip'
That compiler defaults to ARMv5T. That's obviously wrong for an i.MX 6,
which is a Cortex-A9 (ARMv7), but the correction applies for older
processors.
Change-Id: I56c276fa411977dd7cd867d62adf021e4909302c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
QRingBuffer is a fully inlined class used in many I/O classes.
So, it must be as fast and small as possible. To this end, a lot of
unnecessary special cases were replaced by generic structures.
Change-Id: Ic189ced3b200924da158ce511d69d324337d01b6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
main.cpp(332) : warning C4307: '*' : integral constant overflow
tst_qpainter.cpp(1293) : warning C4305: '+=' : truncation from 'double' to 'float'
tst_qpainter.cpp(1474) : warning C4305: '+=' : truncation from 'double' to 'float'
tst_qtbench.cpp(155) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
main.cpp(68) : warning C4189: 'fontHeight' : local variable is initialized but not referenced
Change-Id: If6aadd50df7c5cf7d0f33791c9247730a47ddd27
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
The check has to detect if boost header is present in the system we are
building for.
Change-Id: I700a11df208c8852ba094d8bff387ad21fa309b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Some quick benchmarks against GNU coreutils 8.21 and OpenSSL 1.0.1e
(time in µs; time for coreutils and OpenSSL include the loading of the
executable):
Qt Coreutils OpenSSL
n SHA-1 SHA-224 SHA-512 SHA-1 SHA-224 SHA-512 SHA-1 SHA-224 SHA-512
0 0 0 0 717 716 700 2532 2553 2522
64k 120 484 381 927 1074 966 2618 2782 2694
Diff 120 484 381 210 358 266 86 229 172
The numbers for Qt are pretty stable and vary very little; the numbers
for the other two vary quite a bit, since they involve launching and
executing separate processes. We can take the lesson that we're in the
same ballpark for SHA-1 and we should investigate whether our SHA2
implementation is sufficiently optimized.
Change-Id: Ib081d002ed57c4f43741eca45ff5cd13b97b6276
Reviewed-by: Richard J. Moore <rich@kde.org>
Currently the only supported SPDY version is 3.0.
The feature needs to be enabled explicitly via
QNetworkRequest::SpdyAllowedAttribute. Whether SPDY actually was used
can be determined via QNetworkRequest::SpdyWasUsedAttribute from a
QNetworkReply once it has been started (i.e. after the encrypted()
signal has been received). Whether SPDY can be used will be
determined during the SSL handshake through the TLS NPN extension
(see separate commit).
The following things from SPDY have not been enabled currently:
* server push is not implemented, it has never been seen in the wild;
in that case we just reject a stream pushed by the server, which is
legit.
* settings are not persisted across SPDY sessions. In practice this
means that the server sends a small message upon session start
telling us e.g. the number of concurrent connections.
* SSL client certificates are not supported.
Task-number: QTBUG-18714
[ChangeLog][QtNetwork] Added support for the SPDY protocol (version
3.0).
Change-Id: I81bbe0495c24ed84e9cf8af3a9dbd63ca1e93d0d
Reviewed-by: Richard J. Moore <rich@kde.org>
When drawing to and from the less common formats most of the cpu time
is spend in conversion. The conversion method is rather slow due to
using variable shifts and masks that the compiler does not have a chance
to optimize.
This patch changes the conversion methods to being templates fed by
constexpr methods. This allows the compiler to fully optimize the methods
yielding 2x->5x speedups.
The reliance on constexpr however means the optimized methods are only
used under C++11.
Change-Id: I2ec77c4c1c03f12ee463a694a2b59db0f0b52db1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
According to my profiling of Qt Creator, qHash and the SHA-1 calculation
are the hottest spots remaining in QtCore. The current qHash function is
not really vectorizable. We could come up with a different algorithm
that is more SIMD-friendly, but since we have the CRC32 instruction that
can read 32- and 64-bit entities, we're set.
This commit also updates the benchmark for QHash and benchmarks both
the hashing function itself and the QHash class. The updated
benchmarks for the CRC32 on my machine shows that the hashing function
is *always* improved, but the hashing isn't always. In particular, the
current algorithm is better for the "numbers" case, for which the data
sample differs in very few bits. The new code is 33% slower for that
particular case.
On average, the improvement (including the "numbers" case) is:
compared to qHash only QHash
Qt 5.0 function 2.54x 1.06x
Qt 4.x function 4.34x 1.34x
Java function 2.71x 1.11x
Test machine: Sandybridge Core i7-2620M @ 2.66 GHz with turbo disabled
for the benchmarks
Change-Id: Ia80b98c0e20d785816f7a7f6ddf40b4b302c7297
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
the diff -w for this commit is empty.
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we
need to support windows phone in the target branch while it is not there
in the current stable branch (as of Qt 5.2).
Conflicts:
configure
qmake/generators/win32/msvc_nmake.cpp
src/3rdparty/angle/src/libEGL/Surface.cpp
src/angle/src/common/common.pri
src/corelib/global/qglobal.h
src/corelib/io/qstandardpaths.cpp
src/plugins/platforms/qnx/qqnxintegration.cpp
src/plugins/platforms/qnx/qqnxscreeneventhandler.h
src/plugins/platforms/xcb/qglxintegration.h
src/widgets/kernel/win.pri
tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
tools/configure/configureapp.cpp
Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
Tweak a handful of tests which didn't compile on this platform.
Change-Id: I208d9eb289dfb226746c6d0163c3ea752485033b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Changed the processing of non-character code handling in the UTF8 codec.
Non-character codes are now accepted in QStrings, QUrls and QJson strings.
Unit tests were adapted accordingly.
For more info about non-character codes,
see: http://www.unicode.org/versions/corrigendum9.html
[ChangeLog][QtCore][QUtf8]
UTF-8 now accepts non-character unicode points; these are not replaced
by the replacement character anymore
[ChangeLog][QtCore][QUrl]
QUrl now fully accepts non-character unicode points; they are encoded as
percent characters; they can also be pretty decoded
[ChangeLog][QtCore][QJson]
The Writer and the Parser now fully accept non-character unicode points.
Change-Id: I77cf4f0e6210741eac8082912a0b6118eced4f77
Task-number: QTBUG-33229
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Remove irrelevant test subdirs via .pro files
- Follow WinCE codepaths where applicable
- Replace unsupported Win32 APIs with WinRT equivalents
This does not aim to fix any failures in the tests themselves; it only
makes them compile.
Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Remove benchmark tests that are no longer required as they are simple
overloads of other methods.
Change-Id: I610211543d17c077f482fa2145ac3da7d0767282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add support to QDateTime for time zones using the new QTimeZone class.
[ChangeLog][QtCore][QDateTime] Add support for a new Qt::TimeZone
spec to be used with QTimeZone to define times in a specific
time zone.
Change-Id: I21bfa52a8ba8989b55bb74e025d1f2b2b623b2a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids dynamic construction of the private class. According to
the benchmark we go from 4,550 to 3,900 instruction reads per iteration.
(without change 32629676 the baseline is 5,600)
Change-Id: I5df925e30dbd49bdde87173e481820574ce5abe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The current question is whether activeThreadCount() should be lock-free
(using atomic ints) or mutex-protected, so this tests start()
and activeThreadCount() directly.
Change-Id: Ica4a2ad023c2002e3c7d81558e6b9ee64af7f690
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QFSFileEnginePrivate::canonicalized has been gone for a very, very long time now
(since d3b152ba1e3cd38dd675c801474105d518bacb44 in Qt 4).
This also fixes a build failure in the code on Windows.
Change-Id: I81f5e0c1d644b1b4d75644626eb394a663535387
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Each pair of (normal request, preconnect request) requires only one
socket. E.g. if there is 1 preconnect request in-flight and 2 normal
requests, we need only 2 sockets in total, and not 3.
Therefore, we need to keep track of whether a request is
preconnecting or a normal one.
Task-number: QTBUG-31594
Change-Id: If92ccc35abadfa6090d64ee92bd466615909c94c
Reviewed-by: Richard J. Moore <rich@kde.org>
Compilation failed because "open" is defined as "open64" in fcntl.h.
This definition is reverted now.
Change-Id: I9badcf11131320c53e442cd5b8b21bb5aa4efee5
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
When calling intersect() on a large (1000000 items) QSet, with a small
(1000 items) QSet as the argument, the function takes signifcantly
longer than when the operand and the argument are reversed. This is
because the operand set is always iterated over in its entirety.
This patch changes intersect() to iterate over the smaller set. This
reduces the large operand scenario's benchmark to ~0.000063
milliseconds, compared to the current ~134 milliseconds:
1000000.intersect(1000) = empty: 0.000063 (was 134)
1000.intersect(1000000) = empty: 0.000039 (was 0.000036)
1000000.intersect(1000) = 500: 0.10 vs (was 130)
1000.intersect(1000000) = 500: 0.023 vs (was 0.093)
1000000.intersect(1000) = 1000: 0.20 vs (was 139)
1000.intersect(1000000) = 1000: 0.017 vs (was 0.016)
Task-number: QTBUG-22026
Change-Id: I54b25c49c78c458fef355e9c6222da8a64c7681f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If an app knows it needs to connect to a host beforehand, it can "warm up" the
connection cache by making DNS lookup, TCP (and if needed SSL) handshake before
the actual HTTP request is sent. When the HTTP request is made, it will be
considerably faster when there is already a working connection.
Here are some typical results from the benchmark:
* Linux desktop with Ethernet:
"http://www.google.com" full request: 279 ms, pre-connect request: 61 ms,
difference: 218 ms
"https://www.google.com" full request: 344 ms, pre-connect request: 60 ms,
difference: 284 ms
* mobile device (BlackBerry 10) with Wifi:
"https://www.google.com" full request: 898 ms, pre-connect request: 159 ms,
difference: 739 ms
"http://www.google.com" full request: 707 ms, pre-connect request: 200 ms,
difference: 507 ms
Task-number: QTBUG-30771
Change-Id: I3566b7f08216ab93a39e2024ae7d1ceb7ae21891
Reviewed-by: Jonas Gastal <gastal@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Void is not constructible, so there is no point in checking how fast
it can be constructed.
Change-Id: Icb4b607bebce30fff5fc57b105101f019e0e0db5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
In some situations we can get into resizeSections in a hidden
QHeaderView. If the headerView is hidden then we look at all the
rows, and that can be extemely expensive for a large model.
This patch limits the sizeHint with only looking at a maximum
1000 rows. Though this is more inaccurate it is also faster -
and it is not much different from what QTreeView does.
Change-Id: Ief4b54c5a3c5a0db02e8b595c9b9b3162633ee67
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
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>
It was only used for toUpper/toLower but always computed in the
constructor, including QString::toLatin1 conversion and allocations.
This needlessly slows down all other uses, including supposedly "cheap"
operations QString::toDouble, or accesses inside QResourceFileEngine.
The benchmarks indicates that doing it always when needed is bearable.
There's still a lot of improvement potential on these code paths.
Change-Id: I88b637ee11f9f7ea614f8da4ec5df0bf40664fce
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
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>
Use Q_OS_WINCE ifdef in both method declaration and definition,
in addition combine QT_NO_PROCESS and Q_OS_WINCE ifdefs to one line.
Change-Id: I0787e4341c41b46a5fc089f24a538c0ad40a0875
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>
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>
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>
Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.
Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp
Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.
Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>