Skip to content

Conversation

evnchn
Copy link
Collaborator

@evnchn evnchn commented Jun 1, 2025

Motivation

While working on #4820, I noticed that the FPS of NiceGUI's ui.scene is low. I originally though it was Three.js performance issue, but their demo's running at a smooth 120FPS, so I thought what gives?

As it turns out, it's hard-coded to 20FPS (requestAnimationFrame(() => setTimeout(() => render(), 1000 / 20));)

While we're at it, added on the Stats module from Three.js to visualize difference.

Implementation

  • Don't hardcode it, accept fps prop
  • Add on the Stats module from Three.js to visualize difference.
    • Update npm.json

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • Pytests have been added (or are not necessary).
  • Documentation has been added (or is not necessary).

-> Pytest should be unnecessary, otherwise the testing load may be huge.

@evnchn evnchn added feature Type/scope: New feature or enhancement ⚪️ minor Priority: Low impact, nice-to-have labels Jun 1, 2025
@falkoschindler falkoschindler added the review Status: PR is open and needs review label Jun 2, 2025
@falkoschindler falkoschindler self-requested a review June 2, 2025 11:22
@falkoschindler
Copy link
Contributor

Thanks, @evnchn!

Quick question: Am I right to assume that we need to add Stats.js to npm.json?

@evnchn
Copy link
Collaborator Author

evnchn commented Jun 2, 2025

Yes. You'd need that to download the file.

See image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Type/scope: New feature or enhancement ⚪️ minor Priority: Low impact, nice-to-have review Status: PR is open and needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants