Commit 2c7b1cf7 authored by Jaime Torres Amate's avatar Jaime Torres Amate

From 22% of cpu in hasTransientInternal to 0.2x%

According to callgrind, checking kwin in release with debug symbols,
22% of cpu time in the method hasTransientInternal is spent doing
a cast to Client *, while at the begining of the method, the cast to
const Client * only uses 1.0x%.

Test Plan:
The workload was just show 50 messagebox copying small files and being
unable to change the permissions.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent 1e096467
......@@ -726,7 +726,7 @@ bool Client::hasTransientInternal(const Client* cl, bool indirect, ConstClientLi
for (auto it = transients().constBegin();
it != transients().constEnd();
++it) {
Client *c = dynamic_cast<Client *>(*it);
const Client *c = qobject_cast<const Client *>(*it);
if (!c) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment