-
Suggestion
-
Resolution: Fixed
-
P4: Low
-
None
-
631127126cc14e7c01cc611532b3256b58785670
A class similar to QStringRef (QByteArrayRef?) would be very useful for processing binary messages containing binary or encoded text data.
The attached microbenchmark project compares QString/QStringRef creation performance using QString::mid(), QString::fromRawData() and QString::midRef(). This benchmark more or less shows how much of a performance gain can be expected in similar tight message parsing loops.
Output of an example run:
Config: Using QTest library 4.8.4, Qt 4.8.4
PASS : QStringRef_Test::initTestCase()
RESULT : QStringRef_Test::benchmarkQString():
1.0 msecs per iteration (total: 70, iterations: 64)
PASS : QStringRef_Test::benchmarkQString()
RESULT : QStringRef_Test::benchmarkFromRawData():
0.77 msecs per iteration (total: 99, iterations: 128)
PASS : QStringRef_Test::benchmarkFromRawData()
RESULT : QStringRef_Test::benchmarkQStringRef():
0.68 msecs per iteration (total: 88, iterations: 128)
PASS : QStringRef_Test::benchmarkQStringRef()
PASS : QStringRef_Test::cleanupTestCase()
Totals: 5 passed, 0 failed, 0 skipped
| For Gerrit Dashboard: QTBUG-36918 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 79385,9 | Introduce QByteArrayRef class. | dev | qt/qtbase | Status: DEFERRED | -1 | 0 |