Kata 07

rAF Batcher

WebSocket updates the book in a ref immediately; rAF batches how often React repaints. Toggle batching and use Flood 200 to compare render counts. Flood 10,000 with batching ON — renders should tick by ~1.

closed

WS messages

0

React renders

0

should stay low when batched

Msgs / render

—

higher = more coalescing

Last burst

0

Live L2 and large floods are coalesced to one book apply per animation frame, then one React paint when batching is on. Counters use refs; setState runs in pushToReact only.

Spread: — · bids 0 · asks 0

Bids

PriceSize

Flood or wait for live data

Asks

PriceSize

Flood or wait for live data