-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Focused text entry consumes 40%-80% of CPU in my app #1946
Comments
Can you please fill out that issue template when opening bug reports? I see that you have used it, but then removed all of the template. Please just use the template which contains the necessary information to diagnose the issues. Thanks for understanding 🙂 |
@Jacalz updated |
Thanks 🙂 |
I see this issue on Linux Mint x64 with fyne v2.0.3. CPU usage seems to be around 25% here and the application has to have focus / be topmost for CPU usage to spike. |
Are you also using fyne_demo when you see the problem @bebo-dot-dev ? |
Hi @andydotxyz I wasn't using the fyne_demo when I saw this, I was playing with my little proof of concept application ..but now that you mentioned it, yes I can see it with the fyne_demo application too and CPU usage does seem to be ~40% with fyne_demo |
Looking into this further I think the issue is that the cursor pulses through every possible frame, so the entire UI is refreshing at 60 FPS. Because we're doing Go->C->OpenGL this is expensive even though we are not actually rendering any new textures.
I don't think any of these are simple unfortunately so the short term solution may be #1813 ? |
Thanks for taking a closer look. I've not profiled power usage on a mobile device but this could make using a fyne app on mobile unfeasible. Either the first option of reducing cursor pulse or #1813 could be decent short term solutions. |
Interestingly it seems to be less of a problem on mobile because, in general, there are fewer things on screen. That said it does need to be sorted, though not sure I would switch off animations by default until we know that they are prohibitive. |
Is there any reason not to disable cursor animations on desktop? As far as I'm aware, on pretty much all desktop OSes and toolkits, the cursor just blinks, it doesn't fade in and out. If the CPU load is already less of an issue on mobile, leaving the fading animation on mobile and removing it on desktop would both mitigate the performance issue and make Fyne match desktop conventions more closely. |
I don't think they just blink on/off. At least not the more polished UIs. However we could reduce CPU usage through making it a short transition. |
This was resolved already |
Describe the bug:
I have several forms where text entries can take and lose focus. I noticed that when entry is focused (even without entering any text) the CPU consumption seriously increases.
Screenshots
To Reproduce:
Use any app that contains text entries.
Reproducing conditions:
Platform:
OS X 11.1
Go version:
go1.15.7 darwin/amd64
Fyne version:
v2.0.0
Note: This problem is not reproduced with Fyne v1.4.1.
The text was updated successfully, but these errors were encountered: