[FilteredDirIterator] Avoid RegExp overhead for exact matches
ClosedPublic

Authored by bruns on Jun 4 2019, 2:58 PM.

Details

Summary

Quite a few of the filter strings are exact matches without wildcards,
add an extra QSet for these. This saves about 30% of the runtime cost
of the FilteredDirIterator.

Test Plan

valgrind --tool=callgrind baloo_file

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Jun 4 2019, 2:58 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptJun 4 2019, 2:58 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Jun 4 2019, 2:58 PM
ngraham accepted this revision.Jun 4 2019, 5:35 PM

Brilliant!

This revision is now accepted and ready to land.Jun 4 2019, 5:35 PM
poboiko added inline comments.Jun 4 2019, 5:37 PM
src/file/regexpcache.cpp
60

A quick note for future. There is QRegularExpression::wildcardToRegularExpression(), which apparently does precicely this.
It is there since Qt 5.12 though, while we depend on Qt 5.10. But Plasma already bumped dependency to 5.12, so so we can change it when Frameworks will follow this bump.

This revision was automatically updated to reflect the committed changes.