Built for speed. Engineered for scale.
Every RuntimeJS module is benchmarked against the most popular alternatives. Here's how we stack up — with code examples you can copy today.
Async Flow Control
Composable primitives for parallel, series, queue, retry, debounce, throttle, and structured cancellation.
Benchmark
RuntimeJS12.4ms
lodash/async108ms
Node native32ms
ts
import { parallel, retry } from "runtimejs/async";
const data = await parallel(ids, async (id) =>
retry(() => fetch(`/api/${id}`), { tries: 3, backoff: "exp" })
, { concurrency: 32 });Worker Thread Pools
Type-safe worker pools with zero-copy buffer transfers and automatic load balancing across cores.
Benchmark
RuntimeJS412k ops/s
piscina292k ops/s
workerpool198k ops/s
ts
import { pool } from "runtimejs/workers";
const cpu = pool<(buf: ArrayBuffer) => number>("./hash.worker.ts", 8);
const hash = await cpu.run(buffer);Performance Monitoring
Live event-loop lag, GC pauses, heap snapshots and CPU profiles with one elegant API.
Benchmark
RuntimeJS0.4% overhead
clinic.js1.8% overhead
0x1.1% overhead
ts
import { monitor } from "runtimejs/perf";
monitor.start();
monitor.on("eventLoopLag", ({ ms }) => log.warn("lag", ms));
monitor.on("gc", ({ pauseMs }) => metric("gc.pause", pauseMs));Memory Optimization
Object pools, weak caches, and structural sharing helpers — proven in production at 1B+ requests/day.
Benchmark
RuntimeJS pool−248MB heap
naive new()baseline
lru-cache−112MB
ts
import { ObjectPool } from "runtimejs/memory";
const pool = new ObjectPool(() => new Buffer(64 * 1024), 1024);
const buf = pool.acquire();
try { /* use buf */ } finally { pool.release(buf); }Runtime Introspection
Inspect promises, async hooks, unhandled rejections, and resource lifetimes — without npm bloat.
Benchmark
RuntimeJS0 deps
async-listener6 deps
longjohn2 deps
ts
import { introspect } from "runtimejs/inspect";
introspect.onUnhandledRejection((err, ctx) => report(err, ctx.asyncStack));SSR Utilities
Streaming renderers, hydration boundaries, and edge-runtime adapters for React, Vue, and Solid.
Benchmark
RuntimeJS SSRTTFB 18ms
renderToStringTTFB 58ms
renderToPipeableTTFB 24ms
ts
import { renderStream } from "runtimejs/ssr";
return renderStream(<App />, { onShellReady: respond });