Bandwidth, wire size and latency
16 to 23 Nov 2026
- A player in a full 4 v 4 on a WebSocket gets 8.38 KB/s, down from 11.22. In a room of 24 it is 13.52 KB/s, down from 21.88.
- A room of 8 kept full for a month sends 178 GB instead of 238.
- A new snapshot format halves the snapshot bytes in a 4 v 4, from 3,035 to 1,455 bytes a second. The servers can send it; the page does not ask for it yet.
- At 40 ms ping a key reaches the room about 49 ms after it is pressed and its result reaches the page about 75 ms after. A shorter input cushion saved up to 10 ms but made events show late, so it is off.
Outgoing transfer grows with the square of a room’s size, so the bytes per ball matter most in the big rooms, which are the expensive ones.
Every game room sends each player 60 snapshots a second. This post covers what that costs by room size, the format changes that cut it, a new format that is built but not on yet, and where the time between a key press and the game goes. How the netcode works today is in Netcode; its measurements are in Netcode numbers.
Measured how: the real room and one real page in one process on a virtual clock (the harness our feel tests use), a 40 ms round trip, the other people scripted. Every message both ways is recorded with its size, and transport headers are added per message: on a WebSocket a tick’s messages leave in one write, so one TLS record and one TCP segment a tick. The run is deterministic: the machine’s load changes no byte. These runs were on 16 and 17 Nov on the TypeScript room; the Rust room sends the same bytes for the same game, which is how it was checked.
Where the bytes went
Before the changes, a player in a 4 v 4 got 11.22 KB/s on a WebSocket. Only 57% of that was the game: 4.70 KB/s was TLS, TCP and IP headers on 65 segments a second. Snapshots with their headers were 92% of what came down. Up, 1.99 KB/s, was mostly TCP acknowledging what came down.
What we changed
- The delta coder now predicts each ball the way the physics moves it (its damping and push limits) and sends only the difference, so most balls cost almost nothing when they move as expected. It is lossless.
- The ball index is left out when the order of balls is the same as the last frame.
- The scoreboard sends only the cells that changed: 335 down to 129 bytes a second.
- A room on a real clock asks for one ping a second instead of four.
- On WebTransport, where lost datagrams mean deltas against an acknowledged older snapshot, the prediction runs over the base’s age, which cut those snapshots from 147 to 107 bytes, and the page sends its inputs every second tick: up from 6.01 to 3.42 KB/s.
- Each change is asked for by the page, so an old page keeps the old format.
The saving grows with the room. A snapshot is a fixed part plus a part per ball, and the headers are per message. At 2 people the headers are 74% of what a player gets, so halving the per-ball part saves little; at 24 they are 35%. A player now costs about 5.6 + 0.33 N KB/s on a WebSocket for a room of N (5.8 + 0.68 N before), and a room N times that. On WebTransport the saving is 17% at 2 people and 47% at 24.
| Room always full for 30 days | Before | Now |
|---|
| 2 people | 37 GB | 33 GB |
| 8 people | 238 GB | 178 GB |
| 24 people | 1,394 GB | 861 GB |
| 8 people and 16 spectators | | 538 GB |
Bench, WebSocket, busy game. A spectator gets what a player gets (8.48 against 8.38 KB/s), and spectators change nothing for the players.
Live, the US East server sent each person 3.5 to 3.9 KB a second of game data on 22 and 23 Nov, with headers not counted, and received 147 B/s. At 4 KB a second around the clock a person is 10.4 GB a month, so each server’s 4 TB of included transfer covers far more than its rooms can hold.
A new format, built and not on yet
The coder above still predicted balls in 64-bit doubles. The room moves them in 32-bit floats, so the prediction was off in the last bits and only 0.48 of 8 balls were predicted whole. The new format repeats the physics’ own 32-bit step (damping and the four sub-steps a frame), so a ball predicted whole costs one bit. It also leaves out a frame header that is the last one with the tick one higher, and blocks that did not change. On the Mac, deterministic:
| Scene | Snapshot bytes a second, before / after | On the wire, before / after |
|---|
| 4 v 4 | 3,035 / 1,455 (52% less) | 7,863 / 6,283 (20% less) |
| Tiles and orbs | 3,451 / 1,952 (43%) | 9,122 / 7,623 (16%) |
| Gravity map | 7,389 / 6,815 (8%) | 12,176 / 11,559 (5%) |
| 1 person and 7 bots | 3,393 / 1,923 (43%) | 8,375 / 6,904 (18%) |
Balls predicted whole went from 0.48 to 6.68 of 8 in the 4 v 4. CPU per room-tick was 0.97 times the old.
The servers can send it since 23 Nov. The page half, which asks for it, is not on main yet. An independent review fed the server’s coder 110,000 random and hostile frames and found it matched the reference byte for byte; it also found a bug in the page’s decoder for the formats already live, which is fixed (Fixes, 22 to 23 November).
What a key press costs
The same setup, on 16 Nov: a 3 v 3 with bots, your keys chasing, a 144 Hz screen. Median milliseconds:
| Step | WebSocket, 40 ms ping | WebTransport, 40 ms | WebSocket, 80 ms |
|---|
| Key event to the input leaving the page | 9.0 | 9.2 | 9.9 |
| To the room | 20.6 | 20.7 | 42.0 |
| Waiting at the room for its tick | 19.6 | 18.7 | 43.5 |
| The tick’s snapshot back to the page | 19.3 | 13.9 | 40.8 |
| To the next drawn frame | 3.0 | 3.5 | 4.3 |
| Key to the room running it | 48.9 | 49.0 | 93.0 |
| Key to the page seeing the result | 74.8 | 69.4 | 140.6 |
The netcode setting changes when your own ball moves on screen, not these: Instant moves it at once, Classic at the room’s present, Light with the room’s word.
The wait at the room is the input cushion: the page sends every input a tick or more early, plus the link’s jitter, so none arrives late.
What did not work
- A shorter cushion, trimmed toward 10 ms of spare while the link is steady: at 20 ms ping a key reached the room about 10 ms sooner on a WebSocket (46.8 to 36.7 ms) and 7 ms sooner on WebTransport, with no more late inputs. But our feel tests read 7 rows worse and the packet loss tests 16: spawn events and a portal’s teleport were drawn late. It is off until we know why.
- Sending a key at the key event instead of at the next input tick: the page’s part went to 0, but the room runs the same tick, so the wait at the room grew by the same amount.
- Snapshots every second tick: 6.30 KB/s instead of 11.22, but the feel tests read 51 rows worse. Off.
- An adaptive snapshot rate saved nothing in 4 v 4 play, which is busy every tick, and read 15 rows worse. Off.
- WebSocket compression (permessage-deflate) cut the payload 27% but cost about 260 µs of CPU a message for each socket, several times a room’s whole send cost. Not built.