OPFS sync write benchmark

2026-09-16T05:11:28.540Z · AMD Ryzen 7 7800X3D 8-Core Processor (16 threads), 65 GB, linux 7.0.0-31-generic x64

Config: preset=quick, N=2000, S=4096 B, chunks=64 KiB / 1 MiB, R=3, M=200 · Profiles on: ext4 (/)

Experiment, not a cross-browser comparison.

Per-call write cost

Workloads 1–4. small-overwrite is the fixed per-call floor; small-append adds the cost of growing the file; chunked-append writes the same bytes in far fewer calls; append+flush is a control, since both browsers flush per call. Mean time per call in the median run, log scale; the distance between the marks is the ratio between browsers, printed on the right. Hover a mark for p50 and p99.

Firefox 158
10 µs100 µs1 ms10 mssmall-appendFirefox 158 — small-append: mean 42.1 µs/call, p50 40.0 µs, p99 60.0 µs, total 84.1 msFirefox 158 — small-append: mean 42.1 µs/call, p50 40.0 µs, p99 60.0 µs, total 84.1 mssmall-overwriteFirefox 158 — small-overwrite: mean 38.0 µs/call, p50 40.0 µs, p99 60.0 µs, total 75.9 msFirefox 158 — small-overwrite: mean 38.0 µs/call, p50 40.0 µs, p99 60.0 µs, total 75.9 mschunked-append (64 KiB)Firefox 158 — chunked-append (64 KiB): mean 47.2 µs/call, p50 40.0 µs, p99 80.0 µs, total 5.9 msFirefox 158 — chunked-append (64 KiB): mean 47.2 µs/call, p50 40.0 µs, p99 80.0 µs, total 5.9 mschunked-append (1 MiB)Firefox 158 — chunked-append (1 MiB): mean 195 µs/call, p50 200 µs, p99 220 µs, total 1.6 msFirefox 158 — chunked-append (1 MiB): mean 195 µs/call, p50 200 µs, p99 220 µs, total 1.6 msappend+flushFirefox 158 — append+flush: mean 5204 µs/call, p50 5500 µs, p99 6720 µs, total 10.4 sFirefox 158 — append+flush: mean 5204 µs/call, p50 5500 µs, p99 6720 µs, total 10.4 s
WorkloadFirefox 158 µs/callp50 / p99 (µs)total
small-append
2000 × write(4096 B) at offset = current size; the file grows on every call
42.1 µs40 / 6084.1 ms
small-overwrite
2000 × write(4096 B) at offset 0 into a file pre-sized to 4096 B; the size never changes
38.0 µs40 / 6075.9 ms
chunked-append (64 KiB)
125 × write(65536 B) appending; the same 8192000 B total as small-append
47.2 µs40 / 805.9 ms
chunked-append (1 MiB)
8 × write(1048576 B) appending; the same 8192000 B total as small-append
195 µs200 / 2201.6 ms
append+flush
small-append with flush() after every write (2000 × 4096 B)
5204 µs5500 / 672010.4 s

Per-file cost

Workload 5. Each step of create+open, first write, close and delete timed on its own, per file, plus the full cycle. Populating a file system pays the first three per file. Mean time per call in the median run, log scale; the distance between the marks is the ratio between browsers, printed on the right. Hover a mark for p50 and p99.

Firefox 158
10 µs100 µs1 ms10 msnew-file: create+openFirefox 158 — new-file: create+open: mean 734 µs/call, p50 600 µs, p99 7900 µs, total 146.7 msFirefox 158 — new-file: create+open: mean 734 µs/call, p50 600 µs, p99 7900 µs, total 146.7 msnew-file: first writeFirefox 158 — new-file: first write: mean 70.5 µs/call, p50 60.0 µs, p99 100 µs, total 14.1 msFirefox 158 — new-file: first write: mean 70.5 µs/call, p50 60.0 µs, p99 100 µs, total 14.1 msnew-file: closeFirefox 158 — new-file: close: mean 518 µs/call, p50 180 µs, p99 22.6 ms, total 103.6 msFirefox 158 — new-file: close: mean 518 µs/call, p50 180 µs, p99 22.6 ms, total 103.6 msnew-file: deleteFirefox 158 — new-file: delete: mean 671 µs/call, p50 440 µs, p99 15.9 ms, total 134.3 msFirefox 158 — new-file: delete: mean 671 µs/call, p50 440 µs, p99 15.9 ms, total 134.3 msnew-file: full cycleFirefox 158 — new-file: full cycle: mean 1908 µs/call, p50 1320 µs, p99 17.3 ms, total 381.5 msFirefox 158 — new-file: full cycle: mean 1908 µs/call, p50 1320 µs, p99 17.3 ms, total 381.5 ms
WorkloadFirefox 158 µs/callp50 / p99 (µs)total
new-file: create+open
getFileHandle({create: true}) + createSyncAccessHandle() on a name that does not exist yet
734 µs600 / 7900146.7 ms
new-file: first write
first write(4096 B, {at: 0}) into the empty file
70.5 µs60 / 10014.1 ms
new-file: close
close() on the access handle
518 µs180 / 22620103.6 ms
new-file: delete
removeEntry(name)
671 µs440 / 15940134.3 ms
new-file: full cycle
create+open → write 4096 B → close → delete, per file
1908 µs1320 / 17320381.5 ms

Environment

BrowserVersionModeProfile onperformance.now() stepIsolatedExecutableUser agent
Firefox 158firefox/158.0a1headlessext4 (/)20 µsyes/home/theo/dev/firefox/obj-opt/dist/bin/firefoxMozilla/5.0 (X11; Linux x86_64; rv:158.0) Gecko/20100101 Firefox/158.0
Firefox 158: Bugzilla summary
**OPFS `FileSystemSyncAccessHandle.write()` per-call overhead benchmark**

Environment:
- User agent: `Mozilla/5.0 (X11; Linux x86_64; rv:158.0) Gecko/20100101 Firefox/158.0`
- Platform: Linux x86_64; hardwareConcurrency: 16
- Timestamp: 2026-09-16T05:11:28.540Z
- performance.now() resolution in the worker: 20 µs (crossOriginIsolated: true)
- navigator.storage.estimate(): 2.0 MB used of 10737 MB
- Config: preset=quick, N=2000, S=4096 B, chunks=64 KiB / 1 MiB, R=3, M=200

Median run of R=3 (by total time) after one warm-up pass; latency percentiles are per call; "1st call" is call number 1 of that run (for the append workloads, the first write into the freshly created file):

| Workload | Calls | Bytes/call | Total (ms) | Total min–max (ms) | ops/s | MB/s | p50 (µs) | p90 (µs) | p99 (µs) | max (µs) | 1st call (µs) |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| small-append | 2,000 | 4,096 | 84.1 | 78.0–84.6 | 23,776 | 97.4 | 40.0 | 60.0 | 60.0 | 100.0 | 80.0 |
| small-overwrite | 2,000 | 4,096 | 75.9 | 75.1–80.3 | 26,344 | 107.9 | 40.0 | 40.0 | 60.0 | 80.0 | 80.0 |
| chunked-append (64 KiB) | 125 | 65,536 | 5.9 | 5.9–6.1 | 21,186 | 1388.5 | 40.0 | 60.0 | 80.0 | 80.0 | 80.0 |
| chunked-append (1 MiB) | 8 | 1,048,576 | 1.6 | 1.4–1.6 | 5,128 | 5251.3 | 200.0 | 220.0 | 220.0 | 220.0 | 220.0 |
| append+flush | 2,000 | 4,096 | 10408.9 | 10335.6–10413.9 | 192 | 0.8 | 5500.0 | 5700.0 | 6720.0 | 18100.0 | 5660.0 |
| new-file: create+open | 200 | – | 146.7 | 132.4–148.2 | 1,363 | – | 600.0 | 640.0 | 7900.0 | 13000.0 | 620.0 |
| new-file: first write | 200 | 4,096 | 14.1 | 13.6–14.6 | 14,184 | 58.1 | 60.0 | 80.0 | 100.0 | 120.0 | 80.0 |
| new-file: close | 200 | – | 103.6 | 83.1–105.1 | 1,930 | – | 180.0 | 200.0 | 22620.0 | 23720.0 | 180.0 |
| new-file: delete | 200 | – | 134.3 | 117.1–135.9 | 1,489 | – | 440.0 | 460.0 | 15940.0 | 16660.0 | 540.0 |
| new-file: full cycle | 200 | 4,096 | 381.5 | 366.9–401.1 | 524 | 2.1 | 1320.0 | 1420.0 | 17320.0 | 24780.0 | 1360.0 |

Derived:
- Fixed per-call floor (small-overwrite, size never changes): 38.0 µs/call mean, 40.0 µs p50
- Size-growing write (small-append): 42.1 µs/call mean, 40.0 µs p50
- Extra cost per call when the write grows the file (append − overwrite): 4.1 µs mean, 0.0 µs p50
- Same 8.2 MB in 125 × 64 KiB calls: 5.9 ms (1388 MB/s) vs 84.1 ms for 2,000 × 4 KiB; the small calls are 14.3× slower for the same bytes
- Same 8.2 MB in 8 × 1 MiB calls: 1.6 ms (5251 MB/s) vs 84.1 ms for 2,000 × 4 KiB; the small calls are 53.9× slower for the same bytes
- flush() after every write adds 5162.4 µs/call on top of small-append (append+flush: 5204.5 µs/call mean)
- small-append: first call into the fresh file 80.0 µs vs p50 40.0 / p99 60.0 µs; across runs 60.0–80.0 µs
- chunked-append (64 KiB): first call into the fresh file 80.0 µs vs p50 40.0 / p99 80.0 µs; across runs 80.0–120.0 µs
- chunked-append (1 MiB): first call into the fresh file 220.0 µs vs p50 200.0 / p99 220.0 µs; across runs 220.0–280.0 µs
- append+flush: first call into the fresh file 5660.0 µs vs p50 5500.0 / p99 6720.0 µs; across runs 4560.0–5760.0 µs
- new-file: 1.9 ms per file (524 files/s) = create+open 0.7 + first write 0.1 + close 0.5 + delete 0.7 ms
- new-file without delete (what populating OPFS pays per file): 1.3 ms
- First write into a new file (4 KiB): 70.5 µs vs 42.1 µs per small-append call