When I open a second window, FPS drops in half


#1

Hi :slight_smile:
I created a second window as done in the BasicAppMultiWindow sample. And my framerate dropped in half. Do you know why that is? Maybe because of the constant switching between the 2 GL contexts?


#2

Wild guess: if you’re not issuing any draw calls and the frame rate still drops, it might be caused by vertical sync. If both windows wait for vertical sync, you effectively cut the frame rate in half.


#3

Thanks, that makes sense.
My data so far:

  • 1 window with vsync on: 25 fps
  • 1 window with vsync off: 29 fps
  • 2 windows with vsync on: 15fps
  • 2 windows with vsync off: 20fps

So that kinda helped, but not completely.

Indeed I’m not issuing any draw calls in the second window - only in the first one.

Related:

I tried disableFrameRate(), didn’t help.


#4

Further data:
It turns out that before, I had only disabled vsync for one of the windows.
Now I disabled it for both windows and got 24 fps - basically like the “1 window with vsync on” scenario.

Well, of course that’s not much of a solution, because now I’m getting tearing. :slight_smile:

Btw, I’m on Windows 10 with a nvidia gpu.


#5

I did what you said here, @paul.houx:

https://forum.libcinder.org/topic/new-vertical-sync#23286000001104041

NVIDIA users should:

  • either enable vertical sync, enable triple buffering, disable threaded optimization
  • or disable vertical sync, disable triple buffering, enable threaded optimization

The first option didn’t help.
The second one caused tearing again.