If I understood what I read in the documentation: glfwSwapInterval sets the amount of screen updates we're going to wait until we swap buffers.
Question #1
When I'm profiling, I noticed that glfwSwapBuffers takes almost 16ms and my game occasionally drops a few noticeable frames. If I restart the game, I can sometimes get a solid smooth experience, and other times I get random dips in my framerate. I also read glfwSwapInterval is set to 1 by default, so I'm guessing those 15.x ms, are due to the default interval.
On the other hand, when I set the interval to 0, glfwSwapBuffers() only takes 0.1ms, and my game runs smoothly all the time, no matter how many times I restart it. I'm enjoying the smooth framerate I'm getting now, but isn't it recommended setting the interval to 1 in order to only update when the screen is ready?
Question #2 (also related to glfwSwapInterval)
I noticed if I set it (once) to 0 outside of my game loop, the CPU usage rises a lot more than usual. But if I set it at the beginning of every frame, the CPU usage is a lot less and stable. It seems to me that I should set to 0 within my game loop, but am I using it right?
Thanks!
Btw, maybe not too related, but I'm using a fixed step update loop and interpolating frames at render using the left over accumulated delta time. Just in case it helps.