Glfw stuttering

Good day, I have noticed that occasionaly i get some stuttering during the rendering loop. I have writen a very basic example and I am confindent that my code is not responsbile for it. I also looked into the dwm windows compositing rendering both in windowed and fullscreen mode.
I tried to change from glfwpollevents and glfwwaitevents and i noticed that i get more stuttering using glfwwaitevents. I narrowed the problem to the key input.
Is there a way to mitigate it or totally resolve it ?
Thanks

glfwWaitEvents will wait until an event is posted, i.e. mouse input, keyboard input or other system events occur. This function will thus potentially stall any render loop on the same thread. If you don’t want to wait until an event is received, you should use glfwPollEvents.

The occasional stuttering is still present, even if the vsync is on and the framerate is around 59-60 fps, i get this occasional glitch. I don’t know where to look further, probably this is a driver problem.
I have a Nvidia 3050, but the mother board is 8 years olf, coul dit be the problem ?

There are lots of reasons why you may be experiencing stuttering, with driver problem being fairly low down on the list.

I would investigate the issue using a profiler such as NVIDIA Nsight (if you’re not sure whether it’s a GPU or CPU issue then I think Nsight Systems might be a good place to start).

Note that this forum likely may not be the best place for asking about this since it’s primarily for GLFW specific questions and the stuttering is likely due to your applications use of OpenGL/Vulkan or other code.

I have pinpointed the problem to be the glfwGetTime function ,i have used a timing function written by myself and the stuttering problem is less frequent. Its 100% related to input keyboard input handling. Using glfwGetTime the problem presents itself for both mouse and keybaord, using my timing function, the problem appears to be caused only by key inputs.

I recommend you use a profiler to diagnose the problem. The interactions of the GPU and CPU can be difficult to diagnose which is where something like NVIDIA NSight Systems would come in handy. You may also find that a profiler such as Tracy can be helpful.

I understand that you want to protect your intellectual property about glfw, but i have used the tools you are mentioning, and the problem is related to glfpollevents and keyinput.
We are switching to sdl to see if the problem persists.
Thanks for your time

I understand that you want to protect your intellectual property about glfw

This is not what I was trying to do - I was trying to help you diagnose a performance problem. I don’t own any intellectual property to do with GLFW (it’s open source) nor do I gain anything from people using it.

but i have used the tools you are mentioning

At no point did you state this. Information from such tools may have been helpful in diagnosing the issue.

the problem is related to glfpollevents and keyinput.

This is insufficient information to help diagnose the issue. I’ve not seen this problem, and cannot replicate it (though I also do not have enough information to know what the actual symptoms of the issue are).

We are switching to sdl to see if the problem persists.

Good luck! If you need to report an issue to the SDL team remember that they do not have your system and setup and may not be able to replicate your issue.

There is no need to wish bad luck to anyone, we are adults, thanks for your time

I was genuinely wishing you good luck. SDL is an excellent library.

Sorry, my bad, sarcasm is difficult to detect without a formal language inflection