Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue? #78

Open
MalpenZibo opened this issue Oct 18, 2024 · 2 comments
Open

Performance issue? #78

MalpenZibo opened this issue Oct 18, 2024 · 2 comments

Comments

@MalpenZibo
Copy link

I recently completed porting my application from the layer shell library used by the pop_os team to this project.

In the process, I noticed an increase in CPU usage, both in an idle state and especially in some circumstances. I know that I'm a bit too general and also I moved from Iced12 to Iced13 in the process so it could be a regression (even if it's a major one so it seems strange to me).

Anyway, I will try to find more details, in the meantime three major things that I noticed are:

Scrollable

The scrollable widget has major issues during scrolling (both with the mouse and trackpad). It's almost impossible to scroll and the scroll freezes on the top and after a while reach instantly the bottom, so it's not a smooth experience.
In this case, I notice a huge increase in CPU usage.
The "old" version goes from 0.0%/0.2% to 1.0% during the scroll. Now goes from 0.2%/0.4% to 3.8%.

Slider

In this case, the situation is similar. I notice more or less the same CPU usage increment. The experience is smooth but the value changes during the user interaction with values that are not what are currently selected. (it's difficult to explain).
The problem here could be caused by me. On the audio slider on_change I call my PulseAudio using an iced Task, after setting the audio the pulseaudio subscription sends a Message with the new audio value.
If the interaction is too slow could happen:

  • the slider has a 15 value
  • the user moves the slider causing an on_change(30) message,
  • I send the on_change to pulse audio,
  • the user continues its interaction causing an on_change(50)
  • the pulse audio subscription sends the message with the new audio value (30)
  • the slider value is updated to 30 from 50 causing the graphical glitch

In this case, I could handle better the interaction but before this issue didn't appear. Could be related to the iced update from 12 to 13, the performance issue, or both. The spike in CPU usage remains strange.

Moving the mouse

Moving the mouse over a button caused an increase in CPU usage from 0.2% to 2.2% before it was 0.1% to 0.6%. If I open a submenu (so another wayland layer shell) it's even more evident because I trigger the submenu closing when I click in a specific zone of the layer and the close event lags quite a bit. Sometimes, I have to click multiple times to close the submenu.

Conclusion

I know that's a lot of stuff. I have no hurry and I don't expect to see everything resolved. I'm here only to give you feedback on a "real-world example" in case you want something to work on.

I will try my best to find the root cause of these problems but for me, it's difficult because first I have to study the codebase 😅

@Decodetalkers
Copy link
Collaborator

Decodetalkers commented Oct 18, 2024

Sometimes, I have to click multiple times to close the submenu.

I already know this issue.. I think maybe it is because that time, the events are too many... I do not very know how to fix it..

@Decodetalkers
Copy link
Collaborator

Ok. seems I have fixed some problems...

@Decodetalkers Decodetalkers pinned this issue Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants