Skip to main content

5 posts tagged with "Benchmarks"

Benchmark results and methodology.

View All Tags

Your React Code, Faster Than React

· 5 min read
Andrei Baikov
Exodra Creator

@exodra/react-compat implements React's public API on Exodra machines. Alias react and react-dom to it, and a React application — its components, its hooks, the libraries it installs — runs with Exodra as the renderer. Add one Babel plugin, and the same source mounts faster than it does on React itself.

That is a claim about a specific application measured in a specific way, so here is the application, the way, and every number.

A Question the DOM Cannot Answer

· 6 min read
Andrei Baikov
Exodra Creator

A renderer that fills ports has two ways to spell a write.

Resolve on every write. The port carries an index, the plan carries a table of setters and a table of node slots, and each write walks both:

setters[index](nodes[elem[index]], value)

Resolve once and keep the answer. Hand out a closure that has already done the lookups, so the write is a call:

const write = setters[index];
const at = nodes[elem[index]];
return (value) => { write(at, value); };

The second looks obviously better — the lookup's answer cannot change for the life of the instance, so paying for it repeatedly looks like waste. That reasoning is why a renderer grows a second write path in the first place.

We measured it on the DOM. The measurement refuses to answer, and the refusal is the result.

WeakMaps Are the Cleaner Separation — Patching Is Faster

· 8 min read
Andrei Baikov
Exodra Creator

:::note This post measures a renderer that has been deleted

The WeakMap<schema, record> measured below, the {type, attrs} schema objects it was keyed by, and the ExoNodeDom renderer around them are gone (packages/core/src/index.ts:10-12, packages/dom/src/index.ts:9-10). The measurement stands as a measurement; the code it was taken on does not exist.

And the conclusion moved on three times. This post's fix was "put the record in a slot on the schema object". After that the record became a TExoNodeDom that the CHILD owns (packages/dom/src/dom/types/TExoNodeDom.ts), with the element pointing back under Symbol.for('exo.child') — and on 2026-08-30 that back-pointer was removed outright, so an element carries nothing at all. The "16% of an initial mount / 2.4–2.8× faster" figure that used to be quoted for it is withdrawn: it was measured for a schema→record table, never for an element-keyed one. What replaced it is the axis child-mark / pool, which prices an element expando against a WeakMap entry directly.

It is kept because a post is a record of what was believed when it was written. :::

A while back I wrote about why Exodra's WeakMap core beats the legacy one. Everything in that post is still true about design. This one is about what happened when I finally measured it: the renderer's WeakMap<schema, record> was costing about 11% of every mount, and moving the record onto a slot on the schema object got it back.

Fewer Allocations Made It Slower — A V8 Hidden-Class Lesson

· 6 min read
Andrei Baikov
Exodra Creator

:::note This post measures a renderer that has been deleted

The iterative DOM build walk below — the per-node traversal frame, the context object, the visitor wrapper — belonged to the ExoNodeDom three-props renderer, which no longer exists (packages/core/src/index.ts:10-12, packages/dom/src/index.ts:9-10). There is no per-render tree walk to allocate for any more: a schema is compiled once per process into a prototype element, a walk plan and a setter per port, and a row is a cloneNode plus one indirect call per port (packages/dom/src/index.ts:5-7).

The lesson is the part that survives, and it is why the post is kept: V8 sizes an object's in-object property store from the shape it is constructed with, so building an object whole beats growing it afterwards — and "fewer allocations" is a hypothesis about performance, not a finding, until it is measured.

It is kept because a post is a record of what was believed when it was written. :::

I refactored Exodra's DOM build walk to allocate less per node. It came out 11% slower. Here is exactly why — with the measurements that caught it and the one-line change that fixed it.

Why the WeakMap Core Is a Better Design Than the Legacy One

· 4 min read
Andrei Baikov
Exodra Creator

:::note This post has been superseded, and the renderer it argues about is deleted

Exodra no longer uses a WeakMap for per-node bookkeeping. It first moved to a slot on the schema — see WeakMaps Are the Cleaner Separation — Patching Is Faster — and then the whole ExoNodeDom three-props renderer was removed (packages/core/src/index.ts:10-12, packages/dom/src/index.ts:9-10). Today the record is a TExoNodeDom and the CHILD holds the element, not the other way round (packages/dom/src/dom/types/TExoNodeDom.ts). For a while the element also pointed back, under Symbol.for('exo.child'); that mark was removed on 2026-08-30.

The design argument below still holds; it just lost to a measurement, twice. :::

Exodra moved from a legacy per-node bookkeeping model to a WeakMap-based core. This post is about why that's a better design — less work per node, GC-driven cleanup, and cache-friendly lookups. It is deliberately light on "X% faster" numbers, because the honest, reproducible timings come from npm run bench, not prose.