mapbox / mapbox/mapbox-gl-js

Drag&Drop Example Spins up all CPUs

Open
#4,840 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: performance :zap:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

It seems like our drag&drop example (and maybe others) fire events as fast as possible. This spins up all my CPUs with both Firefox as well as Chrome. The same can be seen in downstream projects using the same mechanism (e.g. [here](https://github.com/mapbox/mapbox-gl-directions/issues/127)).

Ref.

https://github.com/mapbox/mapbox-gl-js/blob/mb-pages/docs/_posts/examples/3400-01-24-drag-a-point.html

### Steps to Trigger Behavior

1. Go to https://www.mapbox.com/mapbox-gl-js/example/drag-a-point/
2. Drag marker around
3. Watch your CPUs getting hot

### Expected Behavior

CPUs stay cold.

### Actual Behavior

CPUs get hot.

---

cc @danswick @ghoshkaj

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 docs/_posts/examples/3400-01-24-drag-a-point.html and reproduce the drag behavior at the linked example URL in Firefox or Chrome. Inspect how dragging fires events; done means dragging the marker no longer drives CPU usage to maximum.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.