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
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
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 ↗ | (On Diff #45834) | Shouldn't we prefer QRegularExpression? |
applets/systemtray/systemtray.cpp | ||
---|---|---|
88 ↗ | (On Diff #45834) | Thought the same, but the new QRegularExpression doesn't allow wildcard matching. |