| Summary: | High CPU usage during animations due to event filters | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] libplasma | Reporter: | Loïc Yhuel <loic.yhuel> |
| Component: | libplasma | Assignee: | Marco Martin <notmart> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kde |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Fedora RPMs | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
the potentially two offending event filters we can controls are in Svg and Units, they filter for QApplication events. I can try to make it filtered by a static QObject then just connecting the signals that have to be relayed, we can see if improves things an attempt at it: https://git.reviewboard.kde.org/r/126113/ |
I'm still on plasma 5.3.1 (but with frameworks 5.13), and with a simple spinning animation, plasmashell uses 30% of one core. Using perf top, I see quite a lot of samples in QCoreApplicationPrivate::sendThroughApplicationEventFilters, which is quite unexpected. Even on an idle system, this function is at the top of the profile. Looking with gdb, I see there are many event filters on the application : 214 Units 55 QQmlPrivate::QQmlElement<Plasma::Svg> 118 Plasma::FrameSvg 26 Plasma::Svg 12 suspicious entries (dangling pointers ?) 1 DialogShadows 1 PanelShadows 1 Plasma::ThemePrivate I don't know if it's normal to have so many instances (perhaps there are leaks), but Plasma::Svg and Units should use a singleton as event filter, to avoid calling Units::eventFilter and Svg::eventFilter hundreds of time for each application event. Reproducible: Always