frame rate drops proportionally to number of process instances
shnifer opened this issue ยท 5 comments
Hello!
I added SwapInterval(1) to example/gl21-cube and it gives me a nice 60 fps. But if i run a second cube.exe at the same time they both show only 60/2=30 fps. Third instance drops fps to 60/3 = 20 and so on.
CPU and memory usage is under 30%.
What is the reason, and how can i fix it?
(my system: AMD Athlon II X4, Win 7, Radeon HD 7800 series)
- Where did you add the SwapInterval(1) call? Did you make any other modifications?
- Does the same happen if you make the same modification to gl41core-cube ?
i made two small modifications:
- SwapInterval(1) before main loop
- counter of fps, that print it once per second
setupScene()
tick:=time.Tick(time.Second)
n:=0
glfw.SwapInterval(1)
for !window.ShouldClose() {
select{
case <-tick:
log.Println(n)
n=0
default:
n++
}
drawScene()
window.SwapBuffers()
glfw.PollEvents()
}
i can not check gl41core-cube now. But problems with gl21-cube are important anyway, while gl2 is used by ebiten (and maybe some other engines)
I can't reproduce on macOS:
Perhaps it's an issue that affects Windows only. Or it could be something specific to your system (video card, drivers, etc.).
If you set vsync off with glfw.SwapInterval(0)
, what FPS do you get with just one cube instance? And multiple cube instances?
Maybe the slowdown you're seeing is just that your video card can't render multiple applications fast enough to maintain 60 FPS. It's a very simple example, so the performance should be good, but it is a possibility that you should verify.
With SwapInterval(0) (or just without this call at all) I got monstrous 4000-4500 "fps". If I run 4 instances fps drops to ~2500. Just 2 times slower, not 4 (while taking ~80% of CPU)
so performance of my system is not a key. Something is wrong with vsync in my context
Yes it's some problem with this all - w7x64sp1.
Any progress here?
And next problem is that when moving window then animation is paused.