# When I open a second window, FPS drops in half

**URL:** <https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005>\
**Category:** Uncategorized\
**Created:** [December 29, 2017, 10:07am UTC](https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005 "2017-12-29T10:07:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Monov](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/stefan_monov/32/476_2.png) [@Stefan\_Monov](https://discourse.libcinder.org/u/Stefan_Monov)\
**Post date:** [December 29, 2017, 10:07am UTC](https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005/1 "2017-12-29T10:07:43Z")

</div>

Hi 🙂  
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?

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [December 29, 2017, 10:26am UTC](https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005/2 "2017-12-29T10:26:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Stefan\_Monov](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/stefan_monov/32/476_2.png) [@Stefan\_Monov](https://discourse.libcinder.org/u/Stefan_Monov)\
**Post date:** [December 29, 2017, 11:10am UTC](https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005/3 "2017-12-29T11:10:13Z")

</div>

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:

- [https://forum.libcinder.org/topic/glnext-multi-window-app-framerate-drop](https://forum.libcinder.org/topic/glnext-multi-window-app-framerate-drop)
- [Multi-window vertical sync](http://discourse.libcinder.org/t/multi-window-vertical-sync/342)

I tried disableFrameRate(), didn’t help.

---

<div class="post-metadata">

**Author:** ![Stefan\_Monov](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/stefan_monov/32/476_2.png) [@Stefan\_Monov](https://discourse.libcinder.org/u/Stefan_Monov)\
**Post date:** [December 29, 2017, 11:30am UTC](https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005/4 "2017-12-29T11:30:06Z")

</div>

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. 🙂

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

---

<div class="post-metadata">

**Author:** ![Stefan\_Monov](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/stefan_monov/32/476_2.png) [@Stefan\_Monov](https://discourse.libcinder.org/u/Stefan_Monov)\
**Post date:** [December 29, 2017, 11:44am UTC](https://discourse.libcinder.org/t/when-i-open-a-second-window-fps-drops-in-half/1005/5 "2017-12-29T11:44:40Z")

</div>

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

[https://forum.libcinder.org/topic/new-vertical-sync#23286000001104041](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.
