Micro-optimise screenpool event filter by caching xcb extension offset
ClosedPublic

Authored by davidedmundson on Feb 15 2018, 11:53 AM.

Details

Summary

BUG: 390499

Test Plan

See callgrind in bug report
Added debug in the relevant section, unplugged a monitor. Saw my output

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 15 2018, 11:53 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Feb 15 2018, 11:53 AM
broulik requested changes to this revision.Feb 15 2018, 11:54 AM
broulik added a subscriber: broulik.
broulik added inline comments.
shell/screenpool.cpp
44

Needs x11 guard

This revision now requires changes to proceed.Feb 15 2018, 11:54 AM
mart added a subscriber: mart.Feb 15 2018, 11:55 AM

since the two watched things are screen added and primary screen changed, couldn't the signals be used instead?
i vaguely remember back when i implemented it something about the signals arriving "too late", may this be correct? (and if so, it should go in the comments)

In D10538#206858, @mart wrote:

since the two watched things are screen added and primary screen changed, couldn't the signals be used instead?
i vaguely remember back when i implemented it something about the signals arriving "too late", may this be correct? (and if so, it should go in the comments)

You do have a comment :)

// we don't have any signal about it, the primary screen changes but we have the same old QScreen* getting recycled

jtamate added inline comments.
shell/screenpool.cpp
44

Shouldn't it be a #if HAVE_X11?

jtamate accepted this revision.Feb 15 2018, 4:20 PM

Even the number of calls registered are less, now most of the time is spent doing the eventType != "xcb_generic_event_t".

This revision was not accepted when it landed; it landed in state Needs Review.Feb 15 2018, 4:43 PM
This revision was automatically updated to reflect the committed changes.