visgl / visgl/deck.gl

Using Shared WebGL context with Mapbox causing performance issues

Open
#3,904 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Description

Using Mapbox and Deck.GL shared WebGL context will cause the map to keep rerendering a lot more and using several layers will cause it to almost keep rerender infinitly causing the CPU to go to almost 100% and making the map lag when rendering

Repro Steps
  • CodeSandbox example that reproduces the behavior

If you compare the amount of times onAfterRender triggers when using a shared WebGL Context instead of a sepereate one (uncomment line 103-107) the amount of times it rerenders is a lot more. In our app we have several layers instead of one and it keeps rerendering and causing the browser to use almost 100% cpu.

Environment
  • Framework Version: [e.g. deck.gl 7.3.6]
  • Browser Version: [Firefox 71, Chrome 78.0]
  • OS: [Mac OS X 10.4.6]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and compare the shared WebGL context with the separate context described around lines 103–107. Observe the onAfterRender frequency and CPU usage when using multiple layers; done means shared-context rendering no longer causes excessive rerendering or near-100% CPU usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, data-visualization, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.