Skip to content

Conversation

@Berckan
Copy link

@Berckan Berckan commented Feb 6, 2026

Summary

  • Reduces SDL_Delay(100) to SDL_Delay(16) in the main render loop idle path (nextui.c:3307)
  • Changes effective framerate from ~10fps to ~60fps when the UI is idle (no dirty flag)
  • Single-line change with zero risk

Context

The render thread's idle branch had a 100ms delay, making the game switcher and quick menu feel sluggish. Two identical SDL_Delay(100) calls at lines 1868 and 1908 were already commented out by the team, and the nearby else branch (line 3322) already uses SDL_Delay(17) — confirming 16-17ms is the intended frame timing.

This aligns with the existing inline comment: "why are we running long delays on the render thread, wtf?"

Testing

  • Running on a Trimui Brick (tg5040) since Feb 6, 2026 with no issues
  • UI navigation is dramatically smoother
  • No increase in CPU usage or heat (16ms is still a sleep, not a spin)

The main render loop had a 100ms SDL_Delay in the idle path,
limiting the UI to ~10fps when the dirty flag wasn't set.
Changed to 16ms (~60fps) to match standard frame budget.

Two identical 100ms delays at lines 1868 and 1908 were already
commented out by the team. The nearby else branch (line 3322)
already uses SDL_Delay(17), confirming 16-17ms is the intended
frame timing.

WHY: The game switcher and quick menu felt sluggish and
unresponsive. This single-line fix makes all UI navigation
dramatically smoother with zero risk — 16ms is the standard
60fps frame budget used across the rest of the codebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant