natanelia/zerocopy / TYPESCRIPT + WEBASSEMBLY

Share your data.
Not copies.

zerocopy is a JavaScript and TypeScript library for shared, immutable collections. One dataset. Your UI and workers, reading together without cloning their backing storage.

Direct reads. Familiar collections. Tasks optional.

01Shared storageNot a full dataset per worker.
02Local readsNo round trip for every value.
03Immutable versionsNew edits. Stable earlier snapshots.
THE GOOD PART

Move the work.
Not the whole dataset.

Search a stream. Inspect a record. Read locally on either thread.

Connect a worker once. A session delivers snapshots. After attachment, .get() is a synchronous local read. It does not ask the main thread for a value.

Understand the model →
Collections hold data. Sessions share snapshots.
Tasks only schedule work.
Main thread · API excerpt
// With your existing state and worker
await state.connect(worker);

// Read directly on the main thread.
state.current.events.get(42);

// New events create a new snapshot.
state.update('events', events =>
  events.push('Upstream timeout')
);
Local read. Not RPC.Complete setup →
ONE LIVE EXAMPLE / LOG EXPLORER

Find the error spike.
Keep new events coming.

Search and summarize 100,000 generated events. Freeze your investigation while ingestion continues. The UI and two reader workers share immutable columns.

Open the log explorer

One example of shared data—not a log-specific library.

Shared snapshots · API excerpt
// The same pattern works beyond logs.
const snapshot = shared.current;

// Read locally during a calculation.
const event = snapshot.events.get(42);

// Keep this snapshot while new data arrives.
// Publish new versions. Leave old reads intact.
Editors · Tables · Catalogs · GraphsExplore use cases →
BUILT FOR SHARED WORK

Big data. Busy interfaces.

Explore the patterns →
YOUR BROWSER. YOUR RESULTS.

Don't benchmark
the marketing.

Compare zerocopy, Immutable.js Map, and Immer Map across workers. Choose the dataset and worker count. Run the actual code, check the output, and keep the raw samples.

Run a live benchmark

No prefilled winner. No result sent to a server.

BENCHMARK LABReady when you are
Shared snapshot
— ms
Immutable.js Map
— ms
Immer Map
— ms
Same inputsRotated orderChecked results

Real timings appear only after you run it.

THE RIGHT TOOL, NOT EVERY TOOL

Keep your stack.
Know the trade-offs.

Start with a collection. Bring your existing workers, Redux store, or message protocol. Add a task pool when you need one.

Find your starting point →
Where zerocopy fits

Large, versioned collections that multiple threads need to read. Log explorers, editors, large tables, catalogs, graph tools, and simulations with a changing dataset.

What you need to know

Browsers need cross-origin isolation. Each arena has one allocating writer. Worker snapshots arrive asynchronously. Long-lived data needs an explicit compaction strategy.

Read the memory guide →
When native collections are better

Small data that stays on one thread. Sharing avoids dataset copies; it does not make every collection operation faster or remove all allocations.

See the full recorded results →
LESS COPYING. MORE BUILDING.

Your next worker
can read the same data.

Connect your first worker Explore the source ↗

Type a topic to find a guide.

↓ ↑ to move · Enter to open · Esc to close

Browse documentation →