OPFS sync write benchmark

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

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

Experiment, not a cross-browser comparison.

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
100 µs1 ms10 msnew-file: create+openFirefox 158 — new-file: create+open: mean 1325 µs/call, p50 1200 µs, p99 8360 µs, total 265.0 msFirefox 158 — new-file: create+open: mean 1325 µs/call, p50 1200 µs, p99 8360 µs, total 265.0 msnew-file: first writeFirefox 158 — new-file: first write: mean 474 µs/call, p50 500 µs, p99 800 µs, total 94.9 msFirefox 158 — new-file: first write: mean 474 µs/call, p50 500 µs, p99 800 µs, total 94.9 msnew-file: closeFirefox 158 — new-file: close: mean 828 µs/call, p50 580 µs, p99 900 µs, total 165.5 msFirefox 158 — new-file: close: mean 828 µs/call, p50 580 µs, p99 900 µs, total 165.5 msnew-file: deleteFirefox 158 — new-file: delete: mean 896 µs/call, p50 600 µs, p99 16.1 ms, total 179.2 msFirefox 158 — new-file: delete: mean 896 µs/call, p50 600 µs, p99 16.1 ms, total 179.2 msnew-file: full cycleFirefox 158 — new-file: full cycle: mean 3525 µs/call, p50 2880 µs, p99 25.5 ms, total 705.0 msFirefox 158 — new-file: full cycle: mean 3525 µs/call, p50 2880 µs, p99 25.5 ms, total 705.0 ms
WorkloadFirefox 158 µs/callp50 / p99 (µs)total
new-file: create+open
getFileHandle({create: true}) + createSyncAccessHandle() on a name that does not exist yet
1325 µs1200 / 8360265.0 ms
new-file: first write
first write(4096 B, {at: 0}) into the empty file
474 µs500 / 80094.9 ms
new-file: close
close() on the access handle
828 µs580 / 900165.5 ms
new-file: delete
removeEntry(name)
896 µs600 / 16080179.2 ms
new-file: full cycle
create+open → write 4096 B → close → delete, per file
3525 µs2880 / 25460705.0 ms

Durability syscalls per call (strace)

fsync,fdatasync,syncfs,sync_file_range counted by strace and attributed to each pass's timed loop by wall-clock window; "per call" divides by calls × passes, warm-up included. "Outside the loop" is the per-pass file creation and deletion that workloads 1–4 do around their timed loop; new-file times those steps inside the loop.

WorkloadFirefox 158 syncs/callms in sync/calloutside loop, per pass
new-file0.120.780.00

Firefox 158: 442 calls, 3.2 s inside them, 395 outside any workload. Most-synced files:

Environment

BrowserVersionModeProfile onperformance.now() stepIsolatedExecutableUser agent
Firefox 158firefox/158.0a1headless, straceext4 (/)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:12:17.762Z
- performance.now() resolution in the worker: 20 µs (crossOriginIsolated: true)
- navigator.storage.estimate(): 2.0 MB used of 10737 MB
- Config: preset=quick+overrides, N=2000, S=4096 B, chunks=64 KiB / 1 MiB, R=1, M=200

Median run of R=1 (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) |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| new-file: create+open | 200 | – | 265.0 | 265.0–265.0 | 755 | – | 1200.0 | 1340.0 | 8360.0 | 8600.0 | 1380.0 |
| new-file: first write | 200 | 4,096 | 94.9 | 94.9–94.9 | 2,108 | 8.6 | 500.0 | 560.0 | 800.0 | 1280.0 | 820.0 |
| new-file: close | 200 | – | 165.5 | 165.5–165.5 | 1,208 | – | 580.0 | 660.0 | 900.0 | 24840.0 | 820.0 |
| new-file: delete | 200 | – | 179.2 | 179.2–179.2 | 1,116 | – | 600.0 | 700.0 | 16080.0 | 25840.0 | 660.0 |
| new-file: full cycle | 200 | 4,096 | 705.0 | 705.0–705.0 | 284 | 1.2 | 2880.0 | 3160.0 | 25460.0 | 28040.0 | 3680.0 |

Derived:
- new-file: 3.5 ms per file (284 files/s) = create+open 1.3 + first write 0.5 + close 0.8 + delete 0.9 ms
- new-file without delete (what populating OPFS pays per file): 2.6 ms