Severe FPS Drop in Dense LineString Areas (Even Without Interaction)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: v3.9.4
**browser**: Chrome Version 132.0.6834.160 (Official Build) (arm64)
### Steps to Trigger Behavior
1. Open https://codepen.io/Lukas-Grubis/pen/qEWzJpj
2. Or open https://codepen.io/Lukas-Grubis/fullpage/qEWzJpj?nocache=true&view=
3. Open Chrome DevTools → More tools → Rendering → Enable "Frame Rendering Stats".
4. Move the mouse cursor inside the looped area, but DO NOT hover over any LineStrings.
5. Observe massive FPS drops (from 60 FPS to ~10 FPS) and 100% CPU usage, even though the cursor is not interacting with any features.
### Link to Demonstration
https://codepen.io/Lukas-Grubis/pen/qEWzJpj
https://codepen.io/Lukas-Grubis/fullpage/qEWzJpj?nocache=true&view=
### Expected Behavior
Moving the cursor inside an area that contains LineStrings (but NOT touching them) should NOT cause a performance drop.
Mapbox should not trigger hit detection or rendering computations unless a feature is actually hovered over.
Frame rate should remain stable at ~60 FPS.
### Actual Behavior
FPS drops drastically (to ~10 FPS) when moving the cursor inside an area with many overlapping LineStrings—even when NOT hovering over them.
CPU usage spikes to 100%.
The issue happens only in areas with a high density of LineStrings.
Zooming in resolves the issue, suggesting a problem with hit detection at lower zoom levels.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodePen reproduction and use Chrome DevTools Rendering with Frame Rendering Stats enabled while moving the cursor through the dense LineString area. Trace the hit-detection or rendering entry point responsible for the FPS drop, and consider the issue resolved when cursor movement outside LineStrings keeps CPU usage and frame rate near normal without interaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100