qt6-bb10/tests/benchmarks/corelib
Ahmad Samir a6ad755734 QStringList: add filter(QStringMatcher) overload
Now that users can pass a QStringMatcher to do the matching, change the
existing overload to not use QStringMatcher.

Thanks to Giuseppe D'Angelo for the idea of passing a QStringMatcher to
filter instead of using a magic number to decide whether to use
QStringMatcher or not.

Results of running filter() and filter_stringMatcher, times are in msecs
and this was compiled with gcc -O3:

              Without       With QStringMatcher
list10        0.00022       0.000089
list20        0.00040       0.00014
list30        0.00058       0.00018
list40        0.000770      0.00023
list50        0.00094       0.00027
list70        0.0012        0.00037
list80        0.0014        0.00041
list100       0.0018        0.00050
list300       0.0054        0.0014
list500       0.0091        0.0023
list700       0.012         0.0032
list900       0.016         0.0041
list10000     0.17          0.045

Drive-by change: optimize tst_QStringList::populateList().

[ChangeLog][QtCore][QStringList] Added filter(const QStringMatcher &)
overload, which may be faster for large lists and/or lists with very
long strings.

[ChangeLog][Possible Performance Changes][QtCore][QStringList] Changed
the implementation of filter(QStringView) overload to not use
QStringMatcher by default. Using QStringMatcher adds overhead, so it is
beneficial/faster when searching for a pattern in large lists and/or
lists with long strings, otherwise using plain string comparison is
faster. If using QStringMatcher makes a difference in your code, you can
use the newly added filter(QStringMatcher) overload.

Change-Id: I7bb1262706d673f0ce0d9b7699f03c995ce28677
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-22 14:37:33 +03:00
..
io Mark all of Qt as free of Q_FOREACH, except where it isn't 2023-08-19 05:19:42 +00:00
itemmodels QSortFilterProxyModel: port to PMF connects for performance reasons 2023-02-02 20:43:59 +01:00
json tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
kernel compressEvents: limit iteration 2023-10-17 21:23:41 +02:00
mimetypes QMimeDatabase benchmark: port away from Q_FOREACH 2023-08-14 23:11:54 +03:00
plugin tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
serialization QCborValue: add benchmark for operator[] 2023-09-06 16:17:52 +02:00
text QStringList: add filter(QStringMatcher) overload 2023-10-22 14:37:33 +03:00
thread Long live QtFuture::makeReadyVoidFuture() and QtFuture::makeReadyValueFuture() 2023-04-05 13:38:15 +02:00
time Simplify (and fix) initialization of a list of time-zones 2023-07-19 22:50:32 +02:00
tools Mark all of Qt as free of Q_FOREACH, except where it isn't 2023-08-19 05:19:42 +00:00
CMakeLists.txt QCborValue: add benchmark for operator[] 2023-09-06 16:17:52 +02:00