Skip to main content

4 posts tagged with "Design Decisions"

The reasoning behind Exodra's design decisions.

View All Tags

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.

Three Attributes Architecture - Maximum Performance Without Runtime Checks

· 6 min read
Andrei Baikov
Exodra Creator

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

Everything below is written about the ExoNodeDom three-props runtime — h(type, attrs), static / bindables / bindableLists, defineComponent, and the @exodra/babel-plugin-jsx compiler. None of that exists any more. @exodra/core states the deletion in its own barrel (packages/core/src/index.ts:10-12), as does @exodra/dom (packages/dom/src/index.ts:9-10), and the babel plugin has been replaced by @exodra/babel-plugin-schema. Do not write code from this post, and do not hand it to an assistant as a description of Exodra.

What survived is the argument, not the API. A component is now one value carrying two halves — a schema built once at module load, and a wiring function run per instance (exoComponent(build, P => wire)). The schema declares ports; the wiring fills them with a verb that says how: c.set once, c.bind kept in step, c.on a listener, c.bindList a reconciled children port. The bucket is gone; "the renderer never has to ask what kind of value this is" is exactly why. See Core Concepts and Getting Started.

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

Every reactive framework faces the same dilemma: how to handle different types of properties efficiently. Most frameworks choose developer convenience over performance. We chose performance.