SystemTray::serviceRegistered is called tons of times; the regexp
construction inside the for-loop is expensive and should be avoided.
Thus construct the regexp once, and re-use the regexp object each time.
Details
Details
Before:
After:
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 5152 Build 5170: arc lint + arc unit
Comment Actions
FWIW, if we use the new https://codereview.qt-project.org/#/c/225432/ we can both remove the regex and have all the filtering done in dbus-server which will save even more
applets/systemtray/systemtray.cpp | ||
---|---|---|
88 | Shouldn't we prefer QRegularExpression? |
applets/systemtray/systemtray.cpp | ||
---|---|---|
88 | Thought the same, but the new QRegularExpression doesn't allow wildcard matching. |