-
Notifications
You must be signed in to change notification settings - Fork 543
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
The ScrollView has a high CPU load when the scrollbar appears #5476
Comments
thanks for reporting an issue. I have checked out your code, but i am not sure how to load data. Could you guide me on how to import data so i can reproduce the problem? Otherwise, one thing to try to figure out where the problem is is to run a profiler such as valgrind or perf to find out what is taking CPU time. Btw, is it a release or debug build? |
Thanks for your reply, I built my code with release. I used For skia renderer, I'm having the issue out of memory. So that I can't test with skia renderer now. I will try to use skia renderer later. Step to run my source code with a simulation data:
|
I think this is probably the same as #5041 |
I updated the features in my project to:
But the issue is still there |
I used the valgrind to do profiling my app, but I have no experiment in reading this file. Could you help me find out what the problems are ? I used callgrind to open this file: |
After looking through all data I have, It seems when we use scroll view with un-fixed value of From the documentation, also mention about the loop inside ScrollView is not fully supported now: https://releases.slint.dev/1.6.0/docs/slint/src/language/widgets/scrollview.html I'm looking forward to having this feature in Slint soon. Thanks for your response |
Perhaps you can try to use a ListView instead of a ScrollView? |
Regarding the way to use kcachegrind, i like to watch at the "Call Graph" tab and go to find which subtree is taking lots of instructions. Also you get better result by unchecking the "Cycle Detection" in the toolbar. |
Thank @ogoffart, It seems my application works more stable when I use ListView, But I got a problem with scrollbar. If I use the mouse hold the scrollbar and move up/down, the animation goes crazy. ListView.webm |
I'm using
ScrollView
andVerticalLayout
to display my data, the CPU load is acceptable (~11%) when displaying just enough data to fit on the screen without needing a scrollbar. However, when I add more data and the scrollbar appears, the CPU load increases significantly (>50%). After that, I expand my window app, the scrollbar disappears and the CPU load goes down again.I'm using Slint with Rust. You can find my source code here: https://github.com/TuEmb/can-viewer
Here is my record for this bug:
can-viewer.webm
The text was updated successfully, but these errors were encountered: