feat: Live Share speaks protocol 2, and each keystroke reaches the others in tens of milliseconds
A keystroke took a second or more to reach another peer, and in the app up to
twenty seconds to reach the host's own window, which waited on its folder's
watch. Now:
- the host tells its own sections what guests change at once, and tells guests
when its own open section publishes, rather than waiting on the watch;
- a guest's background settles a report for 20 ms, not a second, since its host
sends one a commit;
- the host sends what each commit changed (Delta: the header, patches and
appended bytes), and a guest holding the section takes it on without reading
the section again; its own commits apply to what it holds too.
Measured with examples/live_latency (20 keys, keystroke stored in one guest's
replica to the change in another's, and host's file to a guest), median:
before after
loopback LAN 1076 ms 57 ms (host to guest 1026 -> 34 ms)
relay on loopback 1071 ms 57 ms (host to guest 1027 -> 33 ms)
relay.snowbound... - 210 ms (host to guest 137 ms)
Protocol 2 opens with version 2 and answers a peer of another version before
failing, so each end names the other's version: joining says which side must
update Snowbound.
Assisted-by: claude-opus-5.5
02acde3ba6clover caruso committed on 10/3/2026, 12:26:36 PMparentb528713