Skip to content

Improve fps limiter performance - #1398

Open
adfriz wants to merge 7 commits into
leezer3:masterfrom
adfriz:improve-fps-limiter-performance
Open

Improve fps limiter performance#1398
adfriz wants to merge 7 commits into
leezer3:masterfrom
adfriz:improve-fps-limiter-performance

Conversation

@adfriz

@adfriz adfriz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

New: Rewrite FPS limiter for accuracy and performance

Replace the old sleep-based limiter with a cross-platform FrameLimiter
(Thread.Sleep bulk wait + Thread.Yield tail, following OpenTK 4.x).

  • 1ms timer resolution on Windows while waiting; restored on exit
  • Double-precision timeslot calculation for accurate frame pacing
  • Skip raising timer resolution when the frame overran its slot
  • Skip pacing above ~330fps where sleep-based limiting is impractical
  • Make hard FPS cap to 1000; fix OverflowException on unlimited
  • Add 45 and 75 FPS presets to the FPS limit option

I hope this lower the power consumption when use fps preset and better frame pacing.

Vsync options not changed.

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