Skip to content

perf(utils): implement adaptive FPS maximum variant#6497

Merged
mimecuvalo merged 2 commits intomime/adaptive-fpsfrom
mime/adaptive-fps-max-variant
Jul 25, 2025
Merged

perf(utils): implement adaptive FPS maximum variant#6497
mimecuvalo merged 2 commits intomime/adaptive-fpsfrom
mime/adaptive-fps-max-variant

Conversation

@mimecuvalo
Copy link
Copy Markdown
Member

@mimecuvalo mimecuvalo commented Jul 23, 2025

variant on #6470 (this is based on that PR)
@MitjaBezensek wdyt?

Change type

  • improvement

Test plan

  • Unit tests
  • End to end tests

Release notes

  • Improved performance with adaptive FPS throttling.

@mimecuvalo mimecuvalo requested a review from MitjaBezensek July 23, 2025 16:47
@vercel
Copy link
Copy Markdown

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
analytics ✅ Ready (Inspect) Visit Preview Jul 25, 2025 11:13am
examples ✅ Ready (Inspect) Visit Preview Jul 25, 2025 11:13am
1 Skipped Deployment
Name Status Preview Updated (UTC)
tldraw-docs ⬜️ Ignored (Inspect) Visit Preview Jul 25, 2025 11:13am

@mimecuvalo mimecuvalo mentioned this pull request Jul 25, 2025
3 tasks
@mimecuvalo mimecuvalo merged commit 672b20a into mime/adaptive-fps Jul 25, 2025
9 of 11 checks passed
@mimecuvalo mimecuvalo deleted the mime/adaptive-fps-max-variant branch July 25, 2025 11:11
// After collecting enough measurements, set target to the maximum detected FPS
if (measurementCount >= DETECTION_MEASUREMENTS) {
targetFps = maxDetectedFps
targetTimePerFrame = getTargetTimePerFrame(targetFps)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: FPS Detection Overwrites Manual Settings

After the initial FPS detection phase (10 measurements), the system continuously overrides targetFps by resetting it to maxDetectedFps on every subsequent call to updateTargetFps(). This immediately overrides any manual setTargetFps() calls, contradicting documentation that implies manual settings are only overridden if detection is 'still active'. It also leads to redundant assignments of targetFps and targetTimePerFrame even when maxDetectedFps has not changed.

Locations (1)

Fix in CursorFix in Web

@steveruizok steveruizok changed the title perf: adaptive FPS, maximum variant perf(utils): implement adaptive FPS maximum variant Jan 2, 2026
@steveruizok steveruizok added improvement Product improvement sdk Affects the tldraw sdk labels Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Product improvement sdk Affects the tldraw sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants