Closed rh12503 closed 3 years ago
Interesting... looking into this, many people believe this is best solved by the OS. Have you tried setting GOMAXPROCS?
Yes, but it doesn't seem to have any effect so I'm guessing GOMAXPROCS restricts the entire application?
Ah, I see what you're saying, regardless of how many are allocated, the fight is between frontend and backend. Normally, the GUI is running on the main thread so maybe there's a way to prioritise or pin it. Also, just for I.rarest, have you tried adding some sleep()
in the Go code?
I haven't been able to get my Windows machine working recently, but I think that sleep()
would just slow down the entire app. My app only uses 100% of the cores around 70% of the time so it shouldn't be completely frozen.
Do you think using SetThreadPriority()
on the UI thread would work?
2 cents: for me the app ui froze even with just 1 (heavy) thread out of 8. Overall system cpu was 30% and not 100%. It seems the ui and work thread are shared.
Yeah right. I wonder if this is a new thing and there's been a change to the Go scheduler. All your bound methods run in Go routines so it's weird you should see this. Do you have an example that reproduces the issue?
I managed to test it out on a Windows VM, and I've realized the issue is that ie11's SVG renderer is very slow. Sorry for bothering you about this!
The issue is very specific to my app, as I need to render thousands of triangles multiple times per second, but I suppose a sentence could be: "MSHTML's SVG renderer's performance is slower than other browsers, consider using an HTML <canvas>
element instead."
Hopefully v2 will change this!
Right now on Windows, if the backend uses 100% of all CPU cores (eg. multiple Goroutines to calculate something), the UI freezes. This has been an issue for my app https://github.com/RH12503/triangula/issues/5, which uses all CPU cores available when running.
Is there any way to allocate a portion of the CPU to the front end to avoid UI freezes?