Skip to content

Add hash to optimize find_cwindow_in_screen look-ups

bob5972 requested to merge bob5972/xfwm4:master into master

On my system when the window manager is mostly idling (0-12 tiny updates per second), about half the CPU time in xfwm4 is spent in find_cwindow_in_screen, iterating the linked list looking for a matching Window id. Instead, this patch adds a GHashTable to map Window ids to CWindows, completely eliminating that cost in my profiles, resulting in a 0.3-1.0% of a core total CPU reduction for this workload.

Signed-off-by: bob5972's avatar

Edited by bob5972

Merge request reports