Halil Umut Yalçın
Performance & Systems

Visualizing 100+ Hz Sensor Telemetry at 60 FPS with Circular Buffers

Nov 02, 2026•4 min read•Halil Umut Yalçın
Visualizing 100+ Hz Sensor Telemetry at 60 FPS with Circular Buffers

Preventing React Virtual DOM starvation during high-frequency industrial sensor streams using Float32Array circular ring buffers and requestAnimationFrame-throttled canvas rendering.

When High-Frequency Telemetry Stalls the Browser

Industrial equipment — such as turbines, CNC spindles, and compressors — transmits sensor telemetry at 100 to 500 samples per second per channel. Standard web dashboards typically bind incoming data to React state (useState) and render SVG charts.

During a contract project developing industrial telemetry dashboards (Feb–Mar 2025), I was tasked with investigating why a high-frequency sensor dashboard was stuttering under live feeds. Profiling in Chrome DevTools showed the interface dropping to ~14 FPS with ~82% main-thread CPU utilization, accompanied by frequent garbage collection pauses.

Recreating and diffing thousands of DOM/SVG nodes at 200 Hz quickly overwhelms browser layout and compositing pipelines. Before moving to HTML5 Canvas, we first attempted optimizing React state using useRef for data accumulation paired with throttled updates (30 Hz) and memoized SVG components. While this reduced render frequency, managing 10+ concurrent channels still caused visible frame drops during burst traffic. Moving visualization entirely to an HTML5 Canvas backed by a fixed ring buffer delivered predictable 60 FPS performance without React reconciler overhead.

Stream Isolation Objective

Decoupling network ingestion from React state allows the dashboard to absorb 200–500 sensor samples per second while canvas drawing runs smoothly aligned to monitor refresh rates.

Decoupling Ingestion: Float32Array Ring Buffers

Pushing incoming telemetry into dynamic JavaScript arrays causes continuous heap reallocations as arrays grow, triggering frequent V8 garbage collection cycles. On performance timelines, these appear as noticeable micro-stutters.

Instead, we pre-allocate a fixed-capacity Float32Array holding 1,000 samples. New points overwrite the oldest values using modulo pointer arithmetic: head = (head + 1) % capacity. Appending a point is an O(1) operation with zero memory allocation.

WebSocket messages update this buffer directly in memory without calling setState. A separate requestAnimationFrame loop reads the current window from the buffer and paints directly onto an HTML5 Canvas. This aligns drawing frequency with the display's actual refresh rate (whether 60 Hz, 120 Hz, or 144 Hz) rather than the packet arrival rate.

utils/telemetry_ring_buffer.ts (Circular Ring Buffer)typescript
Expand excerpt
export class CircularTelemetryBuffer {
  private buffer: Float32Array;
  private head: number = 0;
  private count: number = 0;
  private capacity: number;

  constructor(capacity: number = 1000) {
    this.capacity = capacity;
    this.buffer = new Float32Array(capacity);
  }

  // O(1) append with zero heap reallocations
  public push(val: number): void {
    this.buffer[this.head] = val;
    this.head = (this.head + 1) % this.capacity;
    if (this.count < this.capacity) this.count++;
  }

  public render(ctx: CanvasRenderingContext2D, width: number, height: number): void {
    const step = width / (this.capacity - 1);
    const startIdx = this.count === this.capacity ? this.head : 0;
    ctx.beginPath();
    for (let i = 0; i < this.count; i++) {
      const val = this.buffer[(startIdx + i) % this.capacity];
      const y = height - (val / 100.0) * height;
      i === 0 ? ctx.moveTo(0, y) : ctx.lineTo(i * step, y);
    }
    ctx.stroke();
  }
}

Chrome DevTools Profiler Measurements

Measurements recorded over 60-second profiles on a Next.js production build using Chrome DevTools Performance & Memory profilers (macOS Apple Silicon, continuous 200 Hz synthetic sensor stream, median of 3 runs):

Profiler Measurements Under Continuous 200 Hz Telemetry Stream
Performance MetricStandard React State (useState)Decoupled Ring Buffer + CanvasResult
Display Frame Rate~14 FPS (Severe stuttering)~60 FPS (Stable rendering)~4.3x smoother
Main Thread CPU Utilization~82% (Thread contention)~9% (Lightweight)~89% CPU reduction
JS Heap Footprint~74 MB (Continuous array churn)~28 MB (Flat baseline, 0 churn)Zero telemetry allocations
GC Pause Duration~45–90 ms (Frequent minor GC)< 3 ms (Negligible)Eliminated GC stutter
Packet Ingestion Latency~120 ms (Queue backlog)< 5 ms (Direct memory write)Real-time signal fidelity
Interactive Live Benchmark Demo

Circular Ring Buffer vs. Naive React State (100 Hz Ingestion)

Click “Start 100 Hz Stream” to simulate real-time sensor packets
Display Frame RateIdleLocked to rAF 60Hz
React Re-Renders0 (Decoupled)Zero VDOM diffing
Heap AllocationsO(1) Fixed1,000-element Float32Array

The Background Tab Trap & Page Visibility API

After deploying the canvas plotter, we noticed client laptop fans ramped up when operators left dashboards open in background browser tabs. While browsers throttle requestAnimationFrame in inactive tabs, background telemetry streams were still triggering canvas calculations.

We resolved this using the Page Visibility API. When document.hidden is true, the canvas draw loop pauses completely while the ring buffer continues absorbing incoming WebSocket data in memory. Once the user returns to the tab, visual rendering resumes instantly at current values without telemetry loss.

Trade-off: Direct canvas rendering bypasses React's declarative component model. Interactive features such as hover tooltips require manual coordinate math (hit-testing) rather than built-in DOM event listeners. For high-frequency telemetry, however, the rendering stability significantly outweighs the added development overhead.

Engineering Scope & Implementation Retrospective
My Direct Contribution:

Profiled main-thread bottlenecks, designed the circular Float32Array ring buffer for O(1) appending with zero heap churn, built the Canvas 2D requestAnimationFrame rendering loop, and integrated the Page Visibility API tab throttle.

Wider Team / Platform Scope:

The client's backend engineering team maintained the industrial gateway that streamed binary WebSocket packets from remote compressor telemetry feeds.

Measurement Methodology:

Captured 60-second profiles on a Next.js production build using Chrome DevTools Performance and Memory profilers under a synthetic 200 Hz sensor stream on macOS Apple Silicon.

What I'd Do Differently Today:

For multi-series dashboards with 20+ simultaneous sensors, I would evaluate an OffscreenCanvas running inside a Web Worker to move canvas rendering entirely off the main UI thread.

Halil Umut Yalçın

Written by Halil Umut Yalçın

Software Engineer • Building regulated clinical systems, PACS/DICOM workflows, and high-reliability web applications.

Discuss this article or collaborate →
Author & Editorial Disclosure:These technical notes reflect production implementations, postmortems, and architectural decisions by Halil Umut Yalçın at Medisan. Large Language Models (Claude / AI tools) assisted in article structure, editorial drafting, and English phrasing. All code implementations, benchmarks, and clinical validations are verified by the author.