Skip to content

Ideas to update module less when there are no changes (performance) #27

Description

@tuurep

Listening to ConfigureNotify has the effect that a lot of module updates are done when dragging and moving, or dragging and resizing a window, which allows to immediately sort the list by position, but is the biggest performance drawback of the entire program I think?

So let's add a config check, if sort_by is not "position", then we can omit SubStructureNotifyMask from this (if I recall correctly):

windowlist/main.c

Lines 413 to 417 in 27530c9

// Ask X server to send ConfigureNotify and PropertyNotify events for root window
// ConfigureNotify is sent when a window's size or position changes
// PropertyNotify for changes in client list and active window
Window root = DefaultRootWindow(d);
XSelectInput(d, root, SubstructureNotifyMask | PropertyChangeMask);

Also see if solution in #6 causes a lot of events.

Thanks @Dupond:

I've carried out a few performance tests on my machine: in normal use, the impact of the module seems almost non-existent (at least, it's not very different from what it was with my previous script); but when moving a window, my 4 CPUs easily climb to 25 or 30% utilization each (tested with htop), whereas with my previous script, in this same scenario, they remained below 10%.

(from #25)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions