[FilteredDirIterator] Avoid RegExp overhead for exact matches
ClosedPublic

Authored by bruns on Tue, Jun 4, 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.Tue, Jun 4, 2:58 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptTue, Jun 4, 2:58 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Tue, Jun 4, 2:58 PM
ngraham accepted this revision.Tue, Jun 4, 5:35 PM

Brilliant!

This revision is now accepted and ready to land.Tue, Jun 4, 5:35 PM
poboiko added inline comments.Tue, Jun 4, 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.