Skip to content

High CPU usage when accesskit enabled #4527

@sebastiano-barrera

Description

@sebastiano-barrera

Describe the bug

In my app based on egui and eframe, the CPU usage is very high as long as the accesskit feature is enabled. By disabling it, the CPU usage remains under much more acceptable levels, and app itself runs much smoother as well.

(I'm available to work on the bug myself. I'd love some suggestions though; I don't quite see how accesskit/D-Bus traffic could cause this much resource consumption, however much it is.)

To Reproduce
Steps to reproduce the behavior:

  1. Build & run the app with the default set of features for both egui and eframe (checkout: sebastiano-barrera/mcjs@b670e5e).
  2. Scroll around while monitoring CPU usage.
  3. Repeat after rebuilding with accesskit disabled (checkout sebastiano-barrera/mcjs@4980384).

Expected behavior
CPU usage "acceptable" (say, <50%) even while the app is continuously updating (e.g. while scrolling).

Videos

Look at the CPU% column:

Accesskit off, CPU stays < 50%

accesskit.off.cpu.usage.lower.mp4

Accesskit on, CPU stays ~200%

accesskit.on.cpu.usage.high.mp4

Desktop:

  • OS: GNU/Linux
  • Version: Fedora Linux 40
  • Desktop environment: GNOME Wayland

Additional context
I also have some perf profiles taken that point at a decent % of call stacks involving functions called accesskit::* and zbus::*. It's quite large, so I'll provide it only if you reckon it's useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityMore accessible to e.g. the visually impairedbugSomething is brokenperformanceLower CPU/GPU usage (optimize)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions