Slightly optimize Workspace::xStackingOrder

Review Request #122067 - Created Jan. 15, 2015 and submitted

Information
Martin Flöser
kwin
master
67db9b5...
Reviewers
kwin

Callgrind analysis showed that this method has room for improvement.
The bottle neck is mapping the Unmanaged against the list of windows
retreived from xcb_query_tree. The number of windows in that list is
rather large (>1000), which turns the loop into an expensive path.
Workspace::findUnmanaged seems to be too expensive for that due to the
overhead of using a functor and multiple method calls. The Inl. cost
before the optimization for checking ~55,000 windows is 2.46.

The change uses a good old const-iterator based loop over the unmanaged
list to check for the window. This reduces the Incl. cost for checking
~55,000 windows to 0.28.


  

Files


Thomas Lübking
Martin Flöser
Thomas Lübking
Thomas Lübking
Martin Flöser
Review request changed

Status: Closed (submitted)

Loading...