deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

[Bug] deck.gl very power hungry when idle

Open MrMorice opened this issue 1 year ago • 2 comments

Description

Power draw when idle (currently 50% CPU on a MacBook Pro / Safari for simple examples like https://deck.gl/examples/icon-layer) is very high.

Attached a screenshot of the Safari Timeline Power Usage for completely idle state on the Icon Layer Example page https://deck.gl/examples/icon-layer.

Screenshot 2024-07-23 at 19 04 33

Originally posted by @MrMorice in https://github.com/visgl/deck.gl/discussions/9041

Flavors

  • [ ] Script tag
  • [ ] React
  • [ ] Python/Jupyter notebook
  • [X] MapboxOverlay
  • [ ] GoogleMapsOverlay
  • [ ] CartoLayer
  • [ ] ArcGIS

Expected Behavior

Power draw when map is idle should be around 2%.

Steps to Reproduce

Open https://deck.gl/examples/icon-layer in Safari on MacOS or iOS, then use timeline view to profile power usage.

Environment

  • Framework version: [email protected]
  • Browser: Safari, potentially others
  • OS: MacOS, iOS

Logs

No response

MrMorice avatar Aug 14 '24 10:08 MrMorice

Are you able to hover on the flamegraph and see what functions are being called?

I ran the standalone icon-layer example on master and got this flamegraph: image

ibgreen avatar Aug 14 '24 19:08 ibgreen

Hi @ibgreen, thanks for taking a look! Did not find something like the Chrome flame graph in Safari but here are two screenshots from the timeline graph. Maybe this helps?

Screenshot 2024-08-15 at 11 33 47

Screenshot 2024-08-15 at 11 30 49

MrMorice avatar Aug 15 '24 09:08 MrMorice

Hello, I noticed the same thing in our app that contains a deck gl map, when the website was just open and idling I saw a cpu load of around 10%. I investigated our code for issues but could not find one, I eventually found that it was the map doing the load. You can also observe the same behaviour in the example's of deck.gl.

On this page: https://deck.gl/examples/multi-view checking the cpu load I see a constant load of around 5% while that map is not doing anything.

bobdepreziz avatar Feb 03 '25 14:02 bobdepreziz

@ibgreen Do you think there is any chance for a fix on this? This issue is affecting most iOS users and very quickly drains battery while using deck.gl apps. Thank you!

MrMorice avatar Feb 17 '25 09:02 MrMorice