Skip to content

perf: reduce tooltip hover over-rendering in 3d viewer#717

Open
gavin-openops wants to merge 1 commit intotscircuit:mainfrom
gavin-openops:fix/issue-94
Open

perf: reduce tooltip hover over-rendering in 3d viewer#717
gavin-openops wants to merge 1 commit intotscircuit:mainfrom
gavin-openops:fix/issue-94

Conversation

@gavin-openops
Copy link

This PR reduces hover-triggered over-rendering that causes lag while moving across dense 3D scenes.

What changed

  • Added throttling for onHover updates when the hovered object stays the same.
  • Dispatches hover position updates only when:
    • pointer intersection moves meaningfully (distance threshold), and
    • enough time has passed since the last dispatch (~30fps cap).
  • Preserved immediate object-enter/object-leave behavior (unhover still fires instantly).

Why

Issue #94 reports major slowdown while hovering tooltips. The previous behavior pushed state updates on every mousemove + raycast tick for the same object, which can trigger excessive React rerenders.

Validation

  • bun run format:check src/react-three/HoverContext.tsx
  • bun run build
  • bun run test:node-bundle

/claim #94

@vercel
Copy link

vercel bot commented Mar 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
3d-viewer Ready Ready Preview, Comment Mar 1, 2026 9:44pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant