Worker HTTP β Benchmark Suite
Reproducible measurements: main thread vs worker transports
How this works: each scenario simulates identical "server" work (CPU burn + delay + payload generation). The only difference between modes is where the work runs.
Long Tasks are PerformanceObserver longtask entries (Chromium-only). Dropped frames are requestAnimationFrame gaps > 25ms β works in every browser.
100 small requests (sequential)
Pure transport overhead: tiny payload, no server work, fired one after another.
| Mode | Total time | Long tasks | Long task time | Dropped frames | OK / Fail |
|---|---|---|---|---|---|
| Main thread | not run yet | ||||
| Worker (pool=1) | not run yet | ||||
| Worker (pool=4) | not run yet | ||||
1 large response (10MB JSON)
Serialization cost: a single response with a 10MB string payload.
| Mode | Total time | Long tasks | Long task time | Dropped frames | OK / Fail |
|---|---|---|---|---|---|
| Main thread | not run yet | ||||
| Worker (pool=1) | not run yet | ||||
| Worker (pool=4) | not run yet | ||||
50 requests in parallel burst
Pool benefit: 50 requests fired at once, each with 50ms simulated server delay.
| Mode | Total time | Long tasks | Long task time | Dropped frames | OK / Fail |
|---|---|---|---|---|---|
| Main thread | not run yet | ||||
| Worker (pool=1) | not run yet | ||||
| Worker (pool=4) | not run yet | ||||
20 requests + 500ms main-thread CPU burn
Real-world jank case: the UI is busy (heavy CPU) while requests run. Workers should keep frames smooth; main-thread cannot.
| Mode | Total time | Long tasks | Long task time | Dropped frames | OK / Fail |
|---|---|---|---|---|---|
| Main thread | not run yet | ||||
| Worker (pool=1) | not run yet | ||||
| Worker (pool=4) | not run yet | ||||
Large Dataset Streaming (10MB)
Zero memory block: progressively streams a 10MB dataset in chunks with simulated latency.
| Mode | Total time | Long tasks | Long task time | Dropped frames | OK / Fail |
|---|---|---|---|---|---|
| Main thread | not run yet | ||||
| Worker (pool=1) | not run yet | ||||
| Worker (pool=4) | not run yet | ||||