# SDL\_RenderPresent latency and frame stuttering when running background automation environments

**URL:** <https://discourse.libsdl.org/t/sdl-renderpresent-latency-and-frame-stuttering-when-running-background-automation-environments/67430>\
**Category:** Game Development\
**Created:** [April 24, 2026, 7:42pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-latency-and-frame-stuttering-when-running-background-automation-environments/67430 "2026-04-24T19:42:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonnie868](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bonnie868](https://discourse.libsdl.org/u/bonnie868)\
**Post date:** [April 24, 2026, 7:42pm UTC](https://discourse.libsdl.org/t/sdl-renderpresent-latency-and-frame-stuttering-when-running-background-automation-environments/67430/1 "2026-04-24T19:42:42Z")

</div>

Hi everyone,

I’m currently developing a cross-platform 2D engine using SDL2/SDL3, but I’ve hit a strange performance snag where my frame times become highly inconsistent whenever I have my automation tools active in the background.

I am currently using a [safe free](https://deltaexeutor.com/) community setup to handle some automated local logging and script execution on the same machine I use for debugging my render loop. I’ve noticed that whenever the background executor starts a heavy processing cycle, my calls to `SDL_RenderPresent` begin to spike in duration, and I get noticeable micro-stuttering even though my update logic is running at a fixed delta time. It feels like the background process is competing for the same high-priority CPU cycles and GPU command-buffer access that SDL needs to maintain a stable 60 FPS.

I have a few related technical questions for the engine devs here:

I’m not sure if the way a safe free style environment manages its internal threading is causing a resource contention issue with the OS-level window manager or the underlying Vulkan/OpenGL context. Has anyone else encountered performance bottlenecks or “Input Lag” increases in their SDL windows while running high-level script executors in the background? I am also wondering if I should try to safe free the memory usage by adjusting the process priority via `SDL_SetThreadPriority` or if I should consider isolating the executor to a separate core to prevent it from starving the main event loop.

I really need to keep this automation active while I work on my project, but the constant frame drops are making it impossible to accurately test my movement interpolation. If anyone has experience optimizing a development setup for concurrent usage of heavy script executors and SDL-based graphics, I’d love to hear your advice!

Thanks!
