summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qstringbuilder
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Make the license test pass.Frans Englich2009-08-191-0/+40
| | | | | | | This is partly done to address a review comment for S60. Reviewed-by: Marius SO Reviewed-by: Paul
* Add some comparisons with std::string to the QStringBuilder benchmarks.hjk2009-06-041-18/+68
|
* extend QStringBuilder benchmark to handle QT_NO_CAST_FROM_ASCII defined andhjk2009-05-292-56/+122
| | | | undefined.
* QStringBuilder benchmark: make testing of the drop-in replacement ↵hjk2009-05-282-17/+21
| | | | | | | operator+() easier. This adds a few explicit QString(...) casts around operator+() based expressions to make them acceptable for QCOMPARE.
* Introduce a new class QStringBuilder to speed up the creation ofhjk2009-05-282-0/+316
QString objects from smaller chunks. The QStringBuilder class: QStringBuilder uses expression templates (using the '%' operator) to postpone any actual concatenation until it is assigned to an actual QString. At that time it knows the exact sizes of all chunks, can compute the required space, allocates once a QString of appriopriate size and then copies over the chunk data one-by-one. In addition, QLatin1Literal is a drop-in replacement for QLatin1String (which we can't change for compatibility reasons) that knows its size, therefore saving a few cycles when computing the size of the resulting string. Some further saved cycles stem from inlining and reduced reference counting logic (the QString created from a QStringBuilder has typically ref count equal to 1, while QString::append() needs an extra test) Minor changes to the existing QString class: - Introduce QString constructor to create an uninitialized QString of a given size. This particular constructor is used by QStringBuilder class. - Introduce a QT_USE_FAST_CONCATENATION macro to disable the existing overloads of operator+() and helps finding the places where they are used in code. - Introduce QT_USE_FAST_OPERATOR_PLUS. This also disables the existing overloads of operator+() and creates a new templated operator+() with identical implementation of operator%(). This allows code that is compilable QT_CAST_{TO,FROM}_ASCII to use QStringBuilder almost transparently. The only case that is not covered is creating objects like QUrl that are implicitly constructible from a QString from a QStringBuilder result. This needs to be converted explicitly to a QString first, e.g. by using QUrl url(QString(QLatin1String("http://") + hostName)); Reviewed-by: MariusSO