# feat: Live Share speaks protocol 2, and each keystroke reaches the others in tens of milliseconds · clo/snowbound

[View on GitCafe](https://git.cafe/clo/snowbound/commit/02acde3ba6bf8683a349deb02c298332a7c4f4ed)

Repository: [clo/snowbound](https://git.cafe/clo/snowbound)

Visibility: public

Requested revision: 02acde3ba6bf8683a349deb02c298332a7c4f4ed

Requested commit: 02acde3ba6bf8683a349deb02c298332a7c4f4ed

Commit: 02acde3ba6bf8683a349deb02c298332a7c4f4ed

Tree: 77bcf07d81cc0c05b30fbb6cd8084256e9819697

Author: clover caruso

Committer: clover caruso

## Message

```
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

```

## Parents

- [b528713ecc49c4ad7d46c039ac7d0acc2f9e72fe](https://git.cafe/clo/snowbound/commit/b528713ecc49c4ad7d46c039ac7d0acc2f9e72fe?format=markdown)

[Source at this commit](https://git.cafe/clo/snowbound/tree/02acde3ba6bf8683a349deb02c298332a7c4f4ed?format=markdown)
