Recording Buffer Benchmark

Test different storage methods for high-throughput VNC recording (~10MB/s)

1. In-Memory Array

Current approach: Push Uint8Array chunks to a JavaScript array. Simple but memory-heavy.

Ready

2. Pre-allocated Buffer

Allocate a large ArrayBuffer upfront and write into it. Avoids repeated allocations.

Ready

3. Chunked Arrays (64MB blocks)

Store data in fixed-size 64MB ArrayBuffers. Balances memory efficiency with GC pressure.

Ready

4. File Stream (OPFS)

Stream to Origin Private File System. Keeps memory low but requires async writes.

Ready

5. IndexedDB Chunks

Store chunks in IndexedDB. Persistent storage with automatic memory management.

Ready

6. Blob Accumulation

Periodically merge chunks into Blobs. Leverages browser's blob storage.

Ready

Results

Method Status Data Written Time Throughput Peak Memory