Atlaslog
Atlaslog / deck.gl / Tutorial / Performance tuning for 100k points
deck.gl · Tutorial

Performance tuning for 100k points

Quick answer

This tutorial starts by measuring frames with requestAnimationFrame and matching symptoms to four bottlenecks: picking and accessor work on the CPU, fragment fill rate, per-frame layer rebuilds and data copying. It shows stable ids, cached layer instances, precomputed positions, pickable only where needed, useDevicePixels and aggregation. Readers can find the real cost before changing layer types or data volume.

Last verified 2026-11-03 · deck.gl 9.0 · Cite this page
Key points
Example
var frames = 0, last = performance.now(), fps = 0;

function tick(now) {
  frames++;
  if (now - last >= 1000) {
    fps = Math.round(frames * 1000 / (now - last));
    frames = 0;
    last = now;
    label.textContent = fps + ' fps';
  }
  requestAnimationFrame(tick);
}
requestAnimationFrame(tick);
/* 差:每次调用都新建,且没有 id */
deckgl.setProps({
  layers: [new deck.ScatterplotLayer({ data: data, getPosition: getPos })]
});

/* 好:图层实例缓存,只换数据引用 */
var pointsLayer = new deck.ScatterplotLayer({
  id: 'points',
  data: data,
  getPosition: getPos
});
deckgl.setProps({ layers: [pointsLayer] });
Notes
Runnable examplesChinese originalAll Tutorials
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Performance tuning for 100k points. https://www.jingweizhi.com/en/deckgl/tutorials/performance.html (accessed 2026-11-03).