CPU usage seems higher on v2.4.1 than v1.13.1 across all major browsers on Mac and Windows
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 1.13.1 and 2.4.1
**browser**: Firefox 91, Chrome 92, Edge 93, and Safari 14.1.1 on Mac OS 11.4 and Windows 10
### Steps to Trigger Behavior
1. Visit the demonstration links
2. Use browser tools to view tab-specific CPU usage
3. Note that the CPU usage on the v2 example is generally higher (with the specific amount varying somewhat by browser)
### Link to Demonstration
I made a demo where I'm calling setData on a source every 100ms to update the information for about 700 features. This is more frequently than we actually update data in our app that focuses on realtime location information about vehicle fleets, but I wanted to make the difference in CPU usage easy to notice.
v1: https://codesandbox.io/s/mapbox-gl-js-v1-performance-tkp6d
v2: https://codesandbox.io/s/mapbox-gl-js-v2-performance-t02u5
### Expected Behavior
Given the release notes for the v2.x releases, I expected v2 to be less CPU intensive than v1 or remain steady
### Actual Behavior
Here're reasonably representative samples of what I'm seeing on my Macbook Pro 16:
Browser
v1
v2
Increase
Safari
80%
130%
50%
Edge
43%
62%
19%
Firefox
36%
47%
11%
Chrome
15%
18%
3%

Contributor guide
Assessment
This issue has not been assessed yet.