mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

CPU usage seems higher on v2.4.1 than v1.13.1 across all major browsers on Mac and Windows

Open rognstad opened this issue 5 years ago • 2 comments

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%
safari-mac edge-mac firefox-mac chrome-mac

rognstad avatar Aug 19 '21 22:08 rognstad

is this still relevant?

omerbn avatar Sep 06 '24 21:09 omerbn

is this still relevant?

Is that a question for me? I'm not sure how to answer it. I haven't attempted to use v2 since I reported this issue 3 years ago

rognstad avatar Oct 25 '24 16:10 rognstad