freezedry

freezedry · November 2026

freezedry

Run a JavaScript bundle’s initialization once, in the real engine, and ship JavaScript that rebuilds the heap it left behind, with a guard for everything the build machine can’t know and a verifier that checks the result object by object. Code: github.com/jlongster/freezedry Live demo: a React storefront rendered by freezedry

19of 22 real libraries rebuilt heap-identical, checked by an independent verifier
0wrong outputs; everything else bails out and keeps the original code
500/500React pages byte-identical from traced templates, up to 10.7× faster

Section 1

Freeze the heap, not the code

Most bundles spend their first milliseconds building the same objects every time. freezedry runs that work once, in the real engine, and ships the result.

A JavaScript bundle’s initialization is deterministic surprisingly often: modules register themselves, lookup tables are computed, classes and closures are wired together. freezedry runs that initialization at build time inside V8, captures the heap it leaves behind (objects, closures and the scopes they share), and writes JavaScript that rebuilds that heap directly. Anything the build machine can’t know becomes a runtime guard, and when a guard fails the original code runs instead.

The idea is old: it is what Facebook’s Prepack set out to do in 2017. Prepack, though, evaluated your code with its own interpreter, about 35,000 of its 81,000 lines a re-implementation of the ECMAScript spec, and real libraries kept finding the gaps: a missing globalThis, a class feature, an Annex B corner. freezedry has no interpreter. V8 runs the code, so the semantics are exact by construction and every syntax the engine supports works. The work moves to two places: capturing what initialization built, and being honest about what can’t be captured.

Here is the smallest interesting case: three closures over one scope, with state that changed during initialization. A heap snapshot written as JavaScript has to recreate the scope as a real scope, shared by all three functions, with the count it had at the end:

Every output on this page is the verbatim output of freezedry for the input next to it. The table under each one runs the original program and the output in fresh Node processes and compares the results.
Inputclosures.js
var counter = (function () {
  var count = 0;
  var log = [];
  function bump(by) { count += by; log.push(by); return count; }
  return {
    inc: function () { return bump(1); },
    add: function (n) { return bump(n); },
    history: function () { return log.join(","); },
  };
})();
counter.add(40);
counter.inc();
freezedryrun, capture, emit
Succeeds: same result as the original
(function(__h$g) {
  var __h$0 = (function(__h$p) {
    var __h$o = new Array(3);
    var count = 41;
    var log = __h$p[0];
    { const inc = (
function () { return bump(1); }
); __h$o[0] = inc; }
    function bump(by) { count += by; log.push(by); return count; }
    { const add = (
function (n) { return bump(n); }
); __h$o[1] = add; }
    { const history = (
function () { return log.join(","); }
); __h$o[2] = history; }
    return __h$o;
  })([[40, 1]]);
  var __h$1 = { inc: __h$0[0], add: __h$0[1], history: __h$0[2] };
  Object.defineProperty(__h$g, "counter", { value: __h$1, writable: true, enumerable: true, configurable: false });
})(typeof globalThis !== "undefined" ? globalThis : this);
20 lines · 704 bytes · exit 0 · 0.5 s
RunOriginal programfreezedry output
counter.inc(), counter.history()42 / 40,1,142 / 40,1,1

Section 2

How it works

Run, capture, emit, guard, verify. Everything uses Node’s built-in vm, inspector and v8 modules.

  1. 1Runinit code in a fresh, sealed vm context; record every read of the environment
  2. 2Capturewalk the heap via the inspector: [[Scopes]] and heap-snapshot contexts
  3. 3EmitJavaScript that rebuilds objects, closures and their shared scopes
  4. 4Guardrecorded assumptions become a runtime check; on mismatch the original code runs
  5. 5Verifyrun both in fresh contexts; compare the heaps object by object, scope by scope
The freezedry pipeline.

Run. The input runs in a fresh V8 context created with vm.constants.DONT_CONTEXTIFY, so this is a genuine global object with no interceptors in the way. A membrane sits between that global object and its prototype, so every read of a global that isn’t plain ECMAScript (window, process, localStorage) goes through freezedry first.

Capture. JavaScript can’t see inside closures, but V8’s inspector can. Each function’s [[Scopes]] internal property gives the values of its captured variables, and one heap snapshot shows which functions share the same context object, which is the part that matters: two closures over one let count must still share it after the rebuild. Functions and classes keep their source text verbatim; only the state around them is reconstructed.

Emit writes nested scope factories that mirror V8’s context tree, object literals with the right prototypes and property order, typed arrays that share one buffer, settled Promises and classes with their methods. Guard turns the recorded environment reads into one condition. Verify is an independent module that shares no code with the others: it runs the original and the output side by side and walks both heaps in lockstep, comparing every object, descriptor, prototype, closure variable and scope identity.

Because function and class source is reused as written, modern syntax costs nothing. A class with private members, captured with no instances alive, comes out intact inside the scope that holds its captured KEYWORDS set:

Inputprivate-class.js
const KEYWORDS = new Set(["let", "const", "if"]);
class Lexer {
  #pos = 0;
  constructor(src) { this.src = src; }
  #peek() { return this.src[this.#pos]; }
  static isKeyword(w) { return KEYWORDS.has(w); }
  word() {
    let w = "";
    while (this.#pos < this.src.length && /\w/.test(this.#peek())) w += this.src[this.#pos++];
    return w;
  }
  get position() { return this.#pos; }
}
globalThis.lex = (s) => {
  const l = new Lexer(s);
  const w = l.word();
  return (Lexer.isKeyword(w) ? "kw:" : "id:") + w + "@" + l.position;
};
freezedryrun, capture, emit
Succeeds: same result as the original
(function(__h$g) {
  var __h$0 = (function(__h$p) {
    var __h$o = new Array(3);
    const KEYWORDS = __h$p[0];
    let Lexer;
    __h$o[0] = (0,
(s) => {
  const l = new Lexer(s);
  const w = l.word();
  return (Lexer.isKeyword(w) ? "kw:" : "id:") + w + "@" + l.position;
}
);
    __h$o[1] = (
class Lexer {
  #pos = 0;
  constructor(src) { this.src = src; }
  #peek() { return this.src[this.#pos]; }
  static isKeyword(w) { return KEYWORDS.has(w); }
  word() {
    let w = "";
    while (this.#pos < this.src.length && /\w/.test(this.#peek())) w += this.src[this.#pos++];
    return w;
  }
  get position() { return this.#pos; }
}
);
    Lexer = __h$o[1];
    __h$o[2] = __h$o[1].prototype;
    return __h$o;
  })([new Set(["let", "const", "if"])]);
  var __h$1 = __h$0[1], __h$2 = __h$0[2];
  __h$g.lex = __h$0[0];
})(typeof globalThis !== "undefined" ? globalThis : this);
33 lines · 878 bytes · exit 0 · 0.4 s
RunOriginal programfreezedry output
lex("let x"), lex("abc")kw:let@3,id:abc@3kw:let@3,id:abc@3

Binary data is captured byte for byte, including several views over one ArrayBuffer, which is how crc-32 builds its tables. Here freezedry notices that the table builders are pure and cheaper to re-run than to spell out, re-emits them, and keeps the views pointing into the same buffer at the same offsets:

Inputcrc-tables.js
var T0 = (function () {
  var t = new Int32Array(256);
  for (var n = 0; n < 256; n++) {
    var c = n;
    for (var k = 0; k < 8; k++) c = c & 1 ? -306674912 ^ (c >>> 1) : c >>> 1;
    t[n] = c;
  }
  return t;
})();
var TT = (function () {
  var table = new Int32Array(1024);
  for (var n = 0; n < 256; n++) table[n] = T0[n];
  for (n = 0; n < 256; n++) {
    var v = T0[n];
    for (var c = 256 + n; c < 1024; c += 256) v = table[c] = (v >>> 8) ^ T0[v & 0xff];
  }
  var out = [];
  for (n = 1; n < 4; n++) out[n - 1] = table.subarray(n * 256, n * 256 + 256);
  return out;
})();
globalThis.crc = function (s) {
  var c = -1;
  for (var i = 0; i < s.length; i++) c = (c >>> 8) ^ T0[(c ^ s.charCodeAt(i)) & 0xff];
  return ~c >>> 0;
};
globalThis.views = TT;
freezedryrun, capture, emit
Succeeds: same result as the original
(function(__h$g) {
  var __h$dp = Object.defineProperty;
  var __h$0 = (function(){var T0=(function(){
var t=new Int32Array(256);
for(var n=0;n<256;n++){
var c=n;
for(var k=0;k<8;k++)c=c&1?-306674912^(c>>>1):c>>>1;
t[n]=c;
}
return t;
})();
var TT=(function(){
var table=new Int32Array(1024);
for(var n=0;n<256;n++)table[n]=T0[n];
for(n=0;n<256;n++){
var v=T0[n];
for(var c=256+n;c<1024;c+=256)v=table[c]=(v>>>8)^T0[v&0xff];
}
var out=[];
for(n=1;n<4;n++)out[n-1]=table.subarray(n*256,n*256+256);
return out;
})();;return [T0.buffer,TT[0].buffer];})();
  var __h$1 = __h$0[1];
  var __h$2 = (0,
function (s) {
  var c = -1;
  for (var i = 0; i < s.length; i++) c = (c >>> 8) ^ T0[(c ^ s.charCodeAt(i)) & 0xff];
  return ~c >>> 0;
}
);
  var __h$3 = [new Int32Array(__h$1, 1024, 256), new Int32Array(__h$1, 2048, 256), new Int32Array(__h$1, 3072, 256)];
  __h$dp(__h$g, "T0", { value: new Int32Array(__h$0[0], 0, 256), writable: true, enumerable: true, configurable: false });
  __h$dp(__h$g, "TT", { value: __h$3, writable: true, enumerable: true, configurable: false });
  __h$g.crc = __h$2;
  __h$g.views = __h$3;
})(typeof globalThis !== "undefined" ? globalThis : this);
36 lines · 1,175 bytes · exit 0 · 0.4 s
RunOriginal programfreezedry output
crc("hello"), views[2][7], views share one buffer3610a686,-1646839623,30723610a686,-1646839623,3072

Section 3

Mutations and the outside world

Only initialization runs, in a sealed sandbox. What it builds is the result; what it can’t know becomes a guard; what it can’t undo stops the build.

Running real code at build time raises the obvious question: what about everything that code does besides computing? freezedry’s answer has four parts.

Mutations are the result

Only the bundle’s top-level initialization runs, and it runs against a fresh context that shares nothing with the build process. Whatever it mutates (its own objects, the global object, even built-in prototypes when it installs a polyfill) is mutated inside that sandbox, and the final state of the sandbox is exactly what freezedry captures. Deleted properties stay deleted, patched intrinsics are re-applied, and nothing leaks out to the machine doing the build:

A registry that gains and loses an entry during initialization, plus a polyfill on Array.prototype. The output contains only the final state.
Inputfd-mutate.js
var registry = {};
function register(name, fn) { registry[name] = fn; }
register("double", function (x) { return x * 2; });
register("inc", function (x) { return x + 1; });
delete registry.inc;
if (!Array.prototype.last) {
  Array.prototype.last = function () { return this[this.length - 1]; };
}
globalThis.registry = registry;
freezedryrun, capture, emit
Succeeds: same result as the original
(function(__h$g) {
  var __h$dp = Object.defineProperty;
  var __h$0 = (0,
function (x) { return x * 2; }
);
  var __h$1 = (
function register(name, fn) { registry[name] = fn; }
);
  var __h$2 = (0,
function () { return this[this.length - 1]; }
);
  var __h$3 = { double: __h$0 };
  __h$dp(Array.prototype, "last", { value: __h$2, writable: true, enumerable: true, configurable: true });
  __h$dp(__h$g, "registry", { value: __h$3, writable: true, enumerable: true, configurable: false });
  __h$dp(__h$g, "register", { value: __h$1, writable: true, enumerable: true, configurable: false });
})(typeof globalThis !== "undefined" ? globalThis : this);
16 lines · 651 bytes · exit 0 · 0.5 s
RunOriginal programfreezedry output
Object.keys(registry), [1, 2, 3].last()[ [ 'double' ], 3, 42 ][ [ 'double' ], 3, 42 ]

The environment becomes a guard

Feature detection is everywhere in real bundles: typeof window, typeof process, typeof define. freezedry runs initialization against a target profile (browser, worker, Node and others) and records each probe and its answer as an assumption. The output checks all of them at startup and, if any fails, runs the original code instead of the rebuilt heap. The check is cheap: about 0.6 µs for a typical two-clause guard, 3.7 µs for React’s fifteen clauses:

Built for a browser. In Node, where process exists, the guard fails, the original code runs, and the result still matches.
Inputenv-probe.js
var root = typeof window !== "undefined" ? window : globalThis;
var isNode = typeof process !== "undefined" && process.versions != null;
var settings = {
  platform: isNode ? "node" : "browser",
  storage: typeof localStorage !== "undefined" ? "local" : "memory",
};
root.Settings = settings;
freezedryrun, capture, emit
Succeeds: same result as the original
if (!("window" in globalThis && typeof window === "object" && window === globalThis && !("process" in globalThis) && !("localStorage" in globalThis))) {
  (function () {
var root=typeof window!=="undefined"?window:globalThis;
var isNode=typeof process!=="undefined"&&process.versions!=null;
var settings={
platform:isNode?"node":"browser",
storage:typeof localStorage!=="undefined"?"local":"memory",
};
root.Settings=settings;
}).call(this);
} else {
(function(__h$g) {
  var __h$dp = Object.defineProperty;
  var __h$0 = { platform: "browser", storage: "memory" };
  __h$dp(__h$g, "root", { value: __h$g, writable: true, enumerable: true, configurable: false });
  __h$dp(__h$g, "isNode", { value: false, writable: true, enumerable: true, configurable: false });
  __h$dp(__h$g, "settings", { value: __h$0, writable: true, enumerable: true, configurable: false });
  __h$g.Settings = __h$0;
})(typeof globalThis !== "undefined" ? globalThis : this);

}
21 lines · 953 bytes · exit 0 · 0.2 s
RunOriginal programfreezedry output
browser-like host (window, no process){ platform: 'browser', storage: 'memory' }{ platform: 'browser', storage: 'memory' }
Node (process present){ platform: 'node', storage: 'memory' }{ platform: 'node', storage: 'memory' }

Anything else stops the build

Some things can’t be frozen honestly. Reading a host value nobody asserted, reading the clock or a random number, depending on the local time zone, and anything with a real side effect would all bake one build machine’s moment into every user’s bundle. freezedry refuses, names the line, and leaves the original code in place:

Initialization that depends on…InputWhat freezedry reports
a network requestvar config = fetch("/config.json");unknown environment function "fetch()" called during initialization (fd-fetch.js:1:14)
touching the DOMvar root = document.createElement("div");unknown environment value "document.createElement" read during initialization (fd-dom.js:1:21)
scheduling a timervar timer = setTimeout(function () {}, 10);volatile timer API "setTimeout()" called during initialization (fd-timer.js:1:13)
reading the clockvar startedAt = Date.now();volatile API "Date.now()" called during initialization (fd-now.js:1:22)
randomnessvar sessionId = Math.random().toString(36).slice(2);volatile API "Math.random()" called during initialization; pass --allow-volatile=Math.random to bake and document it (fd-random.js:1:22)
the local time zonevar newYear = new Date(2020, 0, 1).getTime();timezone-dependent API "new Date(year, month, ...)" called during initialization; pass --assume-tz=UTC to pin timezone (fd-tz.js:1:15)

Volatile values can be allowed explicitly (--allow-volatile=Date.now bakes the value and documents it; --assume-tz=UTC pins the time zone and adds a guard for it). Seeding Math.random is rejected. State that can’t be reproduced exactly (pending Promises, non-empty WeakMaps, suspended generators, Proxy objects) also stops the build.

And everything is checked

The verifier is the last word. A result only counts when the rebuilt heap is isomorphic to the original one, from the roots down to closure variables and shared scopes. With baked volatiles the verifier replays exactly the recorded values, so it proves equivalence given those values.

Section 4

Results on real libraries

22 libraries and app bundles, from 3.6 KB to 8.9 MB. No wrong outputs; the trade-off is size.

0wrong outputs on 22 workloads, with or without opt-ins
19of 22 verified heap-identical with the documented opt-ins (11 with zero configuration)
148tests in freezedry’s own suite, all passing

The benchmark corpus is the one used for the Prepack revival: 22 real libraries and app bundles, each with a smoke test. Libraries that read the clock, a random number or an unasserted host value during initialization (lodash, immutable, d3-scale, redux, handlebars, React, three, @babel/standalone) bail out with zero configuration and verify once those reads are explicitly allowed. Handlebars is a good example of why running the real engine helps: it installs a globalThis polyfill through Annex B’s __defineGetter__, which Prepack 0.2.54 didn’t model, so Prepack shipped a bundle that throws at startup:

The polyfill pattern from handlebars 4.7.10, reduced.
Inputglobalthis-polyfill.js
(function () {
  if (typeof globalThis === "object") return;
  Object.prototype.__defineGetter__("__magic__", function () {
    return this;
  });
  __magic__.globalThis = __magic__;
  delete Object.prototype.__magic__;
})();

globalThis.HandlebarsMini = {
  VERSION: "4.7.10",
  escapeExpression: function (s) {
    return String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;");
  },
};
Prepack 0.2.54the last release, 2018
Succeeds with a warning: wrong result
(function () {
  var $$0 = {
    enumerable: false,
    configurable: true,
    writable: true
  };
  var _$0 = this;
  var _$1 = _$0.TypeError;
  var _$2 = _$1.prototype;
  var _$3 = _$0.Object;
  var _$4 = _$3.defineProperty;
  var __constructor = function () {};
  var _3 = _$2;
  var _0 = (__constructor.prototype = _3, new __constructor());
  $$0.value = "not an object", _$4(_0, "message", $$0);
  $$0.value = "TypeError: not an object\n    at globalthis-polyfill.js:3:50\n    at globalthis-polyfill.js:1:1", _$4(_0, "stack", $$0);
  throw _0;
}).call(this);
stderr
In input file globalthis-polyfill.js(3:50) Warning PP0023: Program may terminate with exception: not an object
  TypeError: not an object
    at globalthis-polyfill.js:3:50
    at globalthis-polyfill.js:1:1 (https://github.com/facebook/prepack/wiki/PP0023)
Prepack succeeded, reporting 1 warning.
18 lines · 565 bytes · exit 0 · 0.3 s
freezedryrun, capture, emit
Succeeds: same result as the original
(function(__h$g) {
  var __h$0; { const escapeExpression = (
function (s) {
    return String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;");
  }
); __h$0 = escapeExpression; }
  var __h$1 = { VERSION: "4.7.10", escapeExpression: __h$0 };
  __h$g.HandlebarsMini = __h$1;
})(typeof globalThis !== "undefined" ? globalThis : this);
9 lines · 331 bytes · exit 0 · 0.4 s
RunOriginal programPrepack 0.2.54 outputfreezedry output
HandlebarsMini4.7.10 a&amp;&lt;b>TypeError: not an object ✗ differs4.7.10 a&amp;&lt;b>

All 22 workloads (final results, from freezedry’s RESULTS.md). Verified = heap isomorphic to the original, checked by the verifier, and smoke test identical; † = with baked volatile values. Sizes are gzip of the minified output relative to the original, with the default fallback (the original source embedded behind the guard) and with the guard and rebuilt heap only. Speedups are against the original: code cache is a vm run with V8’s code cache; cold is a fresh node process, shown where the original takes at least 5 ms.

WorkloadZero configWith opt-insgzip, with fallbackgzip, residual onlyCode cacheCold node
lodashBails outVerified†3.12×2.15×1.33×0.58×
underscoreVerifiedVerified1.94×1.32×0.97×under 5 ms
ramdaVerifiedVerified2.27×1.33×1.54×0.63×
immutableBails outVerified†2.05×1.11×0.93×0.50×
momentVerifiedVerified2.25×1.26×2.91×0.68×
chroma-jsVerifiedVerified1.95×1.06×1.06×under 5 ms
acornVerifiedVerified2.14×1.14×1.05×0.58×
crc-32VerifiedVerified1.50×1.25×1.00×under 5 ms
markedVerifiedVerified1.92×1.06×1.12×0.87×
d3-scaleBails outVerified†2.32×1.33×1.30×0.44×
reduxBails outVerified†1.27×0.94×1.24×under 5 ms
handlebars-appBails outVerified†2.00×1.04×3.25×1.71×
preact-ssr-appVerifiedVerified1.49×1.06×0.99×under 5 ms
react-ssr-appBails outVerified†2.08×–1.18×0.67×
yaml-router-appVerifiedVerified1.94×1.05×3.31×1.55×
moment-timezoneVerifiedVerified2.33×–1.21×0.91×
prettierBails outBails out–––under 5 ms
highlight-jsVerifiedVerified2.53×–1.01×0.84×
threeBails outVerified†2.18×–0.79×0.63×
mathjsBails outRuns; not verified5.83×–1.83×0.32×
babel-standaloneBails outVerified†2.18×–1.30×0.61×
typescriptBails outRuns; not verified2.24×–0.65×0.49×

mathjs and typescript compile and pass their smoke tests, but the verifier needs more than 12 GB to compare two realms holding 18–19 MB programs, so they are counted as unverified, not as successes. prettier bails out on a non-empty WeakMap, whose entries can’t be enumerated from JavaScript.

The trade-offs

Size. freezedry spells out the heap, and by default it also embeds the original source behind the guard, so outputs are typically 1.25–2.5× the original after minification and gzip (lodash 3.1×, mathjs 5.8×). Without the fallback (--fallback throw, for deployments whose environment is pinned) the rebuilt heap alone is usually within 0.94–1.33× of the original (lodash 2.15×).

Cold start. In a fresh node process, scanning the larger output usually costs more than the initialization it saves (0.4–0.9× on most workloads). With V8’s code cache, where parsing is nearly free, freezedry is faster than the original on 15 of 21 compiled workloads: handlebars and the YAML router app 3.3×, moment 2.9×, mathjs 1.8×, ramda 1.5×. It is slower on three and typescript, where rebuilding a very large heap costs more than the code it replaces.

Explicit opt-ins. Zero-configuration coverage is 11 of 22, because so many libraries read a clock or a random number at load. Every opt-in is a visible decision in the build, not a silent default.

No symbolic reasoning. freezedry knows nothing about inputs that don’t exist yet. It can’t specialize a function for unknown arguments; it can only snapshot what initialization actually did. Where the revived Prepack derives specialized code from a model of the program, freezedry observes the program and guards what it saw. The next section shows how far that goes.

Section 5

React: trace, then specialize

The same run-the-real-thing idea, applied to server rendering: trace real renders, emit guarded templates, fall back to React for anything untraced.

Server rendering a known React app for unknown request data is the classic case for specialization. freezedry’s React mode doesn’t model React at all. It watches it.

The app is instrumented so every operation computes its real result in V8 and, when an operand came from request data, also records the expression. Rendering 70 training inputs through real React yields, for each component, a tree of the branches the data took and the HTML around each data-dependent hole. Host elements are rendered by the real react-dom/server with marker strings in place of data, so escaping and attribute rules come from React itself, and every rule a template relies on is probed against React at build time. A branch the training data never took becomes a numbered fallback, $fb(n), that hands the request to renderToString.

One component of the benchmark app (a 30-component e-commerce page) and the template freezedry generated for it, verbatim. Props are passed positionally ($p0 is shipsAtSec, $p1 is stock); $tn emits a text child after checking its type; $L tracks whether React would insert a <!-- --> separator.
InputStockBadge in app.jsx
function StockBadge(props) {
  var stock = props.stock;
  if (stock <= 0) {
    return (
      <span className="ns-stock ns-stock-out" data-stock-state="out">
        Out of stock
      </span>
    );
  }
  if (stock <= 5) {
    return (
      <span className="ns-stock ns-stock-low" data-stock-state="low">
        Only {stock} left
      </span>
    );
  }
  return (
    <span className="ns-stock ns-stock-in" data-stock-state="in">
      In stock
      {typeof props.shipsAtSec === "number"
        ? " · Ships " + formatDateUTC(props.shipsAtSec, false)
        : ""}
    </span>
  );
}
freezedrytraced template
function $T28($p0, $p1, $tc) {
if (($p1 <= 0)) {
$o += "<span class=\"ns-stock ns-stock-out\" data-stock-state=\"out\">Out of stock</span>";
$L = false;
}

On the benchmark’s fixed 500-input check corpus the output is byte-identical to React: 500 of 500. Two of the 500 fall back, both hand-written edge cases the training data never produced. On 50,000 randomly mutated inputs there were no mismatches at all, and inputs that make the app throw throw the same error. A cached build loads, prepares and renders its first page in about 5 ms, against 16 ms for React.

Renders per second relative to ReactDOMServer.renderToString, same machine, same run (react-bench/perf.js, November 5, 2026). Small pages are about 6 KB of HTML, large ones about 285 KB.

JIT, smallJIT, largejitless, smalljitless, large
React renderToString1.00×1.00×1.00×1.00×
freezedry templates5.68×4.64×10.61×10.68×
Hand-written specialization8.42×6.51×18.53×17.45×

Coverage is only as good as the training data, which is the price of never modeling anything: with 20 + 2 training pages, about 30% of requests fall back. With 70 it is 0.4%, and inputs that fell back can be collected and fed into the next build.

Section 6

What’s left, and where to find it

Open problems, and the code.

The code, tests and full results are at github.com/jlongster/freezedry. Its origins, and the other half of the experiment, are in Prepack, revived.

How this page was made

Every code panel is the unedited output of freezedry (then still called the “hybrid”), produced by site/scripts/run-examples.js in the Prepack revival repository on November 5, 2026, on Node v26.7.0; long lines in the React template wrap. The bail-out messages are the first line freezedry prints for each input. The results table is transcribed by script from freezedry’s final RESULTS.md; the React numbers come from the shared react-bench harness.