v130 · webrtc

Transferable RTCDataChannel to dedicated workers

The RTCDataChannel interface is part of the WebRTC standard, and represents a network channel which can be used for bidirectional peer-to-peer transfers of arbitrary data.

concepts

  1. Transfer probe

    Detects whether the engine accepts RTCDataChannel in postMessage transfer list, and runs a live transfer if so.

  2. Main thread vs worker fan-out

    The chromestatus motivation made tangible: a synthetic high-rate stream simulated against main-thread vs worker-owned channel handling. Watch main-thread fps degrade under load on the legacy side while the transferred side stays at 60.

  3. Quantified benchmark

    Three knobs (message rate, payload size, per-message JS work) and a side-by-side 3-second benchmark of main-thread vs worker-transferred handling. Reports median frame time, long-task count, throughput parity, and a written recommendation for whether your real load profile justifies the transfer.

  4. Worker protocol decoder

    Simulates a binary protocol (type byte + 2-byte length + payload) decoded in a transferred-channel worker. Side-by-side panels show the main-thread path (decode inline, blocking) vs the worker path (decode off-thread). Burst-send up to 20 messages of 4 protocol types and compare per-message timing.

why it shipped

Enabling RTCDataChannel transfers to workers will improve the performance of WebRTC applications, by offloading network send/receive operations from the main thread to a worker thread.

references