Performance
What Papyr costs to run, and what it costs the browser. The numbers summarize measurements committed in
bench/, each with its date, machine, raw output and the command to run it again. Where this page and
bench/ disagree, bench/ is right. Most server numbers come from a shared 8-core x64 Linux machine with other work
running, so CPU varies up to two times between runs; allocations and memory are the stable figures.
The server at a glance
| Binary | One Native AOT executable, about 17 MB (bench/publish-size) |
| Start | About 30 ms until /health answers, 37 ms until the first join, at 0.5 CPU; each stored room adds about 20 µs, or with a cold disk a read of each of its files (bench/startup) |
| Memory, idle | About 30 MB resident; under 45 MB with 150 open connections |
| Memory per idle connection | 16.8 KB of managed heap |
| Memory per stored update | About 130 bytes while its room is loaded |
| CPU, idle | 0.2 ms per second with no connection; 15 µs per second per idle connection |
| Dependencies | The .NET runtime; no database, no other service |
Under load
The load driver (bench/relay-load) behaves like real pages: it encrypts every
message, sends presence once a second per client, answers the server’s requests for snapshots, and measures from the
moment a message should have been sent until another client receives it.
A container limited to half a CPU and 256 MB, (three runs):
| Load | Delivery median / p99 | Server CPU | Memory |
|---|---|---|---|
| 12 rooms of 4 people, everyone typing, 960 edits a second (3,000 deliveries a second) | 1.4-1.7 ms / 17-118 ms | 9-13 % of one core | 38-43 MB |
| The same at 3,840 edits a second (11,700 deliveries a second) | 1.3-1.6 ms / 24-626 ms | 30-38 % of one core | 46-52 MB |
| 48 people joining 6 rooms at once, 2,000 stored edits each | all synced within 30 ms | 51-52 MB |
For scale: a person typing produces a few edits a second. The first row is 200 people typing at once.
Over a real socket on the build machine (no proxy, no TLS):
| Load | Delivery median / p99 | Server CPU |
|---|---|---|
| One room of 4, one person typing | 1.3 ms / 2-8 ms (one run 206 ms: a stall of the busy machine) | 3-4 ms per second |
| 10 such rooms | 1.1 ms / 2-5 ms | 20-24 ms per second |
| One room of 32 people, 2 typing (1,300 deliveries a second) | 1.3 ms / 3-7 ms | 31-34 ms per second |
| 4 rooms typing while another pastes 1 MB and stores an 8 MB snapshot every 10 s | typists 1.2 ms; the paste accepted in 6 ms, the snapshot in 45 ms | 13-16 ms per second |
Per message
What the server does for one message (bench/relay-load):
| Allocated | Time | |
|---|---|---|
| Relay one 100-byte edit to a room of 8, core only | 118 bytes | 7-8 µs |
| The same over WebSockets, end to end | 130-150 bytes | 140-200 µs CPU |
| Join a room with 2,000 stored edits | 24-25 KB, in 14 messages | 0.6-0.9 ms CPU |
| Hash the access key of a hello | 136 bytes | 0.5 µs |
The server decrypts nothing, so encryption costs it only the 28 bytes of nonce and tag on each message.
Blobs
What the server allocates for one upload or download of a blob (bench/blobs, the whole
server over a loopback socket, 2026-11-18, 100 requests per size):
| Blob | Upload | Download | Download by the framework’s Results.File |
|---|---|---|---|
| 64 KiB | 8.9 KB | 6.5 KB | 6.2 KB |
| 1 MiB | 8.8 KB | 21 KB | 22.7 KB |
| 5 MiB | 8.6 KB | 82 KB | 92 KB |
An upload allocates the same 8.7 KB at every size: nothing grows with the blob or is made per chunk, and four uploads
at once hold the server’s RSS where it was (96 MiB). A download adds 0.9 to 1.5 % of the blob’s size (0.009 to 0.015 bytes
per byte, the same at 16, 64 and 256 KiB writes): Kestrel’s own socket send allocates when a send does not complete
at once, as much as Results.File and a little less; the copy loop of ours is flat. A kill -9 in the middle of an upload leaves a .tmp that the next start deletes,
with the total of the blob store exact.
In the browser
- What the room page loads (Brotli-compressed,
bench/pages): about 217 KB the first time: CodeMirror 106 KB, Yjs 26 KB, the page’s own modules 75 KB, style sheets 5 KB. Every script is minified: Yjs and CodeMirror when they are vendored, our own modules and style sheets by the publish, which took a first visit of the room page from 315 KB to 217 KB and of the start page from 21 KB to 14 KB. Highlighting for a code language in a fenced block loads on first use (1-58 KB each). - Loading a page again (
bench/pages, headless Chromium over HTTP/2, 50 ms per answer): scripts and style sheets carry the hash of their content in their names and are cached for good, so a return visit to the room page makes 4 requests (the page and its three images) instead of 81, and shows the editor after about 120 ms instead of 180 ms. The first visit fetches every module in one round trip after the page (<link rel="modulepreload">): the editor after 0.2-0.3 s. - Typing (
bench/codemirror, headless Chromium): a keystroke paints in about one frame (16-21 ms) in documents of up to 750,000 characters, and in 21-52 ms at a million. Above 400,000 characters the Markdown highlighting switches off, and every keystroke paints in one frame whatever the text. - Joining a large room: 1 MB of text shows in about 0.3 s from one update, and in 1.3-1.4 s from 2,000 separate ones.
- Encryption (WebCrypto in Chromium,
bench/contract-crypto): sealing an edit takes about 4 µs, a 1 MB paste about 1.8 ms, an 8 MB snapshot about 15 ms. A page typing five edits a second spends under 0.1 % of a core on it.
Sizing an instance
Every limit is a setting, and configuration.md, “Memory”, gives the formula for the worst case
the settings allow, so a container’s memory limit follows from them. Its example fits 150 connections and 10 loaded
rooms in 256 MB with 30 % to spare; in practice far more fit, since a room that is only typed in uses a small part of
its share.
Running the benchmarks
Each folder of bench/ has a README with the commands:
| Folder | Measures |
|---|---|
relay-load |
The server: allocations, CPU and latency per scenario, locally or against a deployed site |
codemirror |
The room page: what it loads, a keystroke by document size, joins |
pages |
The pages’ first and return visits: requests and time at a fixed latency |
contract-crypto |
The cost of the encryption, server and browser |
http-connections |
Memory per connection that is not a WebSocket |
blobs |
What an upload and a download of a blob allocate and hold by size; a crash during an upload |
publish-size |
The binary’s size and start time |
startup |
The start: its phases, the stored rooms, the CPU limit of a small container, the AOT settings |
etherpad-compare |
Papyr and Etherpad 3.3.17 under the same typing load, in containers with the same limits |
A change that touches the relay reruns the scenarios it could affect and commits the numbers.