qt6-bb10/tests/benchmarks/corelib/text
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
..
qbytearray QByteArray: use new assign() in operator=(const char *) 2023-08-11 14:11:44 +02:00
qchar Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qlocale Fix parsing of numbers to cope with non-single-character tokens 2023-02-24 13:37:07 +01:00
qregularexpression tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
qstring QString: use new assign() in operator=({QByteArray, QChar, char *}) 2023-09-05 20:58:47 +02:00
qstringbuilder Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringlist QStringList: add filter(QStringMatcher) overload 2023-10-22 14:37:33 +03:00
qstringtokenizer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qutf8stringview Add In-place utf-8 case-insensitive comparisons 2022-12-02 11:35:49 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00