Skip to content
Keel
Blog / Engineering

38 milliseconds: where the time goes in a Keel action

Changing a status in Keel takes 38 ms at the median, on every client. A walk through the local store, the render and the sync queue that make that number hold.

When you press S and pick In review, the issue moves in 38 milliseconds at the median across every Keel client. At the 95th percentile it is 61 ms. Those numbers come from real sessions, not a benchmark, and they have held within 4 ms for eighteen months.

There is no trick. The action never waits for the network. This post walks through where the 38 ms go, and the three rules we follow to keep them there.

The budget

  • write to local store4 ms
  • re-render the list11 ms
  • paint23 ms
  • sync to server (background)210 ms

You see the change at 38 ms. The server hears about it later, and nobody waits for that.

Fig. 1 · A status change, measured on a 2023 laptop. The sync bar is dashed because nobody waits for it.

Every client keeps a copy of the workspace in a local store: IndexedDB in the browser, SQLite in the desktop and mobile apps. An action writes there first, in about 4 ms. The list re-renders from the store, which takes 11 ms for a view of 500 issues, and the browser paints. The server hears about it afterwards.

Rule 1: the network is never on the path

Each change becomes an operation in a queue: { issue: “HAL-207”, field: “status”, to: “review”, at: 1730458211 }. The queue drains in the background over one WebSocket. If you are offline it keeps growing, and nothing in the interface changes. When the connection returns, the queue drains in order.

// Simplified: the real queue batches and retries.
function setStatus(id: IssueId, to: Status) {
  store.update(id, { status: to });      // ~4 ms, local
  queue.push({ id, field: "status", to }); // returns at once
}

Rule 2: conflicts are rare, so make them cheap

Two people editing the same field of the same issue within the same second happens about once per 40,000 operations. We resolve per field, last write wins, and keep both values in the history. When a title edit loses, the losing author gets a quiet notice with their text, so nothing typed is ever gone.

Rule 3: measure in CI, every frame

A regression of 10 ms is invisible in a demo and obvious after a week of use. Every pull request runs a scripted session of 300 actions against a 20,000-issue workspace and fails if the median moves by more than 3 ms.

Clientp50p95Local store
Web (Chrome)38 ms61 msIndexedDB
macOS29 ms44 msSQLite
Windows33 ms52 msSQLite
iOS35 ms58 msSQLite

Malik OseiSync engine at Keel, in Rotterdam since 2022.

Keep reading

Ship something by Friday.

Free for three people, for as long as you like. Bring your issues over in minutes.