Reduce plasmashell frozen time
ClosedPublic

Authored by jtamate on Feb 19 2018, 8:08 PM.

Details

Summary

Third part of https://phabricator.kde.org/D10627

According to the documentation at http://doc.qt.io/qt-5/qabstractnativeeventfilter.html

The type of event eventType is specific to the platform plugin chosen
at run-time, and can be used to cast message to the right type.

On X11, eventType is set to "xcb_generic_event_t", and the message can
be casted to a xcb_generic_event_t pointer.

The other eventType are "windows_generic_MSG" and "mac_generic_NSEvent".

No other eventType starts with an 'x'.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jtamate created this revision.Feb 19 2018, 8:08 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptFeb 19 2018, 8:08 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jtamate requested review of this revision.Feb 19 2018, 8:08 PM
mwolff requested changes to this revision.Feb 19 2018, 9:30 PM
mwolff added a subscriber: mwolff.

what? this is totally unsafe - the reinterpret_cast below shouldn't be done on anything that has event names other than the previously used one...

This revision now requires changes to proceed.Feb 19 2018, 9:30 PM

ok, looking at the reasoning in the other commit:

  • you need to extend the commit message here
  • you need to provide a comment in the code the clarifies what's going on here

in general, I don't see how such a comparison can be so costly - the real problem would be too many native events, no? did you maybe profile a debug build or something?

ok, looking at the reasoning in the other commit:

  • you need to extend the commit message here

Will be done.

  • you need to provide a comment in the code the clarifies what's going on here

Will be done.

in general, I don't see how such a comparison can be so costly - the real problem would be too many native events, no? did you maybe profile a debug build or something?

A qstrcmp is more expensive than a single cpu instruction in i586 builds (debug or release), unless it uses SSE4 instruction in the x64 world.

Unfortunately I haven't found what causes so many native events.

jtamate updated this revision to Diff 27672.Feb 21 2018, 11:11 AM
jtamate edited the summary of this revision. (Show Details)

Updated the summary and added a comment

Updated the summary and added a comment

ping? I would like to use the same comment and commit message in https://phabricator.kde.org/D10669

davidedmundson accepted this revision.Mar 20 2018, 4:42 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 21 2018, 6:26 PM
This revision was automatically updated to reflect the committed changes.
hein added a subscriber: hein.Mar 21 2018, 6:33 PM

This revision was not accepted when it landed; it landed in state Needs Review.

Weird, David accepted it though?

In D10670#230938, @hein wrote:

This revision was not accepted when it landed; it landed in state Needs Review.

Weird, David accepted it though?

Yes. Shouldn't this be reported as a bug to phabricator? It has happened to me twice.

hein added a comment.Mar 21 2018, 6:41 PM

I think it's because mwolff did "Requesting changes" and he didn't accept.

Phabricator considers reviews approved only when all individual and group reviewers have approved it.

In this instance, nobody approved on behalf of Frameworks and @mwolff has changes requested still.