Hazel reports · ^report(47) · design note · 2026-11-08, updated 2026-11-09 21:39 MST · work in progress · for ^ticket(718)

First-Order Data in a Form of Its Own

A design note for dev. Closed, first-order values (numbers, strings, booleans, lists, tuples, constructors) pay for the generality of open terms wherever they go: ids on every node, environments substituted into them, a hash of every node to share them. Matthew, 2026-11-08: "let's try to do something systematic for dev that solves this, at the cost of another representation form for first-order data, and no closures", and then: "I'm imagining a special case of Value (or whatever it is called in the core language) def that's especially efficient to serialize for first-order data." And: "Fumola is more efficient than Hazel for these values, and we should try to experiment with these other, more efficient design ideas and submit a plan to the group based on what we find." This note proposes that value form, how it is made and sent, and the experiments to run first; the plan for the group comes from what they find.

Outline#

  1. The goal: a 60 fps floor for small edits; on the Witch slide a step now shows in 19 to 24 ms, its run compiled, and the probes wait 1.4 to 2.0 s for the worker.
  2. Why: the same cost, found again and again; last on the Witch slide, where one module written out in a probe's environment was 3.8 MB of a 5.4 MB answer.
  3. The form: a Data term, a value made only by the evaluator, with no ids, holes, closures or environments inside it.
  4. Beside Fumola's Value: Fumola keeps values apart from terms, and its first-order cases serialize as they are; the cases here are those, inside Hazel's terms.
  5. Why it is cheap to send: no ids, no sharing to find, numbers packed; or not encoded at all, as plain JS values over the browser's own copy.
  6. Which code made a value: kept beside it, keyed by the code's id, as probe samples already are, and as Fumola's graph keeps it; never in the value.
  7. When a value becomes data: first where values leave the evaluator, then in the evaluator itself.
  8. Where it pays, in order: probe samples, the worker's messages, livelit models, hazel-jit, the evaluator.
  9. What it costs: a second form wherever values are read, and the same answers both ways.
  10. What it is not: no sharing, no closures, no holes, no types inside.
  11. The experiments: the same values as Hazel's terms, as data, and as Fumola's values, sent, built and read; measured before anything is proposed.
  12. Experiment 1: sending the Witch's picture: as data, 3.0 times smaller and 2.5 to 4.3 times quicker to send than as terms; as JS values or JSON, quicker still once made; Fumola's side beside it; and treemaps of where the bytes are.
  13. Experiments 3, 4 and 5: a run mints about 189,922 ids, 0.2 to 0.3% of the evaluator's time to mint; printing the picture is 50 to 54 times quicker as data; into JS, about the same either way; Fumola's door into JS is slower than either.
  14. Experiment 2, a first slice: built node by node, the picture costs about the same as data as it does as terms without ids; an id with its tag, kept in a tree, costs 59 to 91 ns, so a run's ids are 1.0 to 2.5% of the evaluator. Building values as data would save at most a couple of percent: the evaluator's time is its own work, so the run has to be compiled.
  15. The plan for the group: written from the experiments and from two slices tried on the livelits branch, which took the Witch's worker answer from 590 to 198 KB; a draft of its slices, and questions for Matthew.

The goal: 60 fps for a small edit#

A slider's step drawn in 16.7 ms, a 60 fps floor for small edits, as a JS app holds. On the Witch slide a step now shows in 19 to 24 ms and a drag runs at about 58 frames a second, the slide's run compiled in the page (^report(51)); the probes still wait for the worker's run, whose answer comes 1.4 to 2.0 s after the step. Matthew, 2026-11-08: "I'd really like Hazel to have a floor of 60FPS for small edits (sliders changing), just like in JS (but well beyond there, obviously)." And: "And each obstacle is worth studying, and overcoming." When this note was begun, a small edit on the Witch took 1.3 to 1.7 s, about 80 to 100 times the goal (^report(46), two cuts, and sharing dropped): the worker's evaluator 0.81 to 0.92 s; the page's own work, about 0.4 to 0.8 s, most of it the whole slide's view drawn again, about 117 ms each time and five times an edit; the trip between the worker and the page, 79 to 102 ms. First-order data is one obstacle among these: it is in what the evaluator builds and in what the worker sends, and the trip it shortens is now the probes'.

Why#

Hazel holds every value as a term, and a closed, first-order value pays for what a term can be: open, holed, a closure over an environment. The cost has come up again and again:

Dev pays more than the branches measured there. Its worker's answer is the run's value and final state as they are: not pruned, with the observation trace, and with the whole incremental cache, which goes to the page and comes back with the next request (WorkerServer.Request.value.prev).

The form#

A new value form in the core language: Data, a closed, first-order value with nothing inside it but data. Dev has no type of values apart from terms: a value is a term that ValueChecker calls a Value. So the special case is a term:

/* Grammar.exp_term, beside Atom, ListLit, Tuple, Constructor, ... */
| Data(Data.t)

/* Data.re */
type t =
  | Atom(Atom.t)                  /* Int, SInt, Nat, Float, Bool, String: the term's own atoms */
  | List(list(t))
  | Tuple(list(field))            /* labeled or not; () is Tuple([]) */
  | Ctor(string, option(t))       /* a constructor, alone or applied */
and field = {
  label: option(string),
  value: t,
};

Beside Fumola's Value#

Fumola keeps its values apart from its terms, and each first-order case of its Value is plain data that serializes and deserializes as it is. The cases proposed here are those cases, inside Hazel's terms. (Matthew, 2026-11-08: "For comparison --- Fumola has a Value type. Each first-order case of Value (most of them) is simple to serialize and deserialize.")

Why it is cheap to send#

Three things a term costs to encode that data does not: its ids, a search for sharing, and boxed numbers. And data could skip encoding altogether.

Which of these to build first is a measurement: the first slice times each on the answers it changes.

Which code made a value: kept beside it#

A value carries no source ids; the association between a value and the code that made it is kept elsewhere, keyed by the code's id. Hazel already keeps most of it that way.

When a value becomes data#

First where a value leaves the evaluator; then in the evaluator itself.

Where it pays, in order#

  1. Probe samples (dev). A sample's value, and each binding in its environment, is data, or opaque (a function, or a value holding one), or, only when it is open, a term. The drawer turns data into a term when it draws it, once per sample shown. This fixes the Witch's case at its root, and every probe on dev with it.
  2. The worker's messages (dev). The program's value, the samples, and the incremental cache's states, in both directions, carry data; measured as bytes and as encode and decode time on each side.
  3. Livelit models (the livelits branches, then dev when they land). A model is first-order by design, written into the program as a literal: data from the start, and each livelit's samples with it.
  4. hazel-jit (^report(45)). Data into JS and back, directly: arrays, numbers, strings, with no term made on the way back; ^ticket(681)'s idea, and the diffs of ^ticket(715) on data. ^ticket(710)'s lists as trees would be a change to Data.List, not to every term.
  5. The evaluator (above): values built as data.

What it costs#

What it is not#

Not a change to holes or to open terms: anything that is not closed, first-order data stays a term, and behaves as it does now. No closures in data, and no holes; no sharing; no types below the root. Programs, and the editor's terms, are untouched: only values can be data.

The experiments#

Before a plan goes to the group, the same values measured each way: as Hazel's terms today, as the data form here, and as Fumola's values, which already work this way. Where things stand on the Witch slide (^report(46)): with a module kept out of a probe's environment, the trace cleared and the answers unshared, a small edit takes 1.3 to 1.7 s, and the worker's evaluator is 0.81 to 0.92 s of it, 50 to 64%; the trip is 5 to 8% (two cuts, and sharing dropped). So the evaluator, building values as terms, is now the larger cost, and sending them the smaller.

  1. Sending. Done 11-08 (below). The Witch's picture (133 shapes, 924 points, 046/data/witch/picture.json) and a probe-heavy answer, encoded and decoded: as Hazel's terms by Marshal (today); as data by Marshal with no sharing table; as data packed (numbers in float arrays); as plain JS values by the browser's structured copy; and as Fumola's Value through serde (its JSON door, and a binary form). Bytes, and ms each way, in Node and in Firefox.
  2. Building. A first slice done 11-08 (below): the picture's nodes built three ways, outside a run, as a ceiling. It puts building values as data at a couple of percent of a run at most, so on this evidence a prototype evaluator would cost more than it could save. The picture built by each evaluator: Hazel's today (terms, a fresh id per node); Hazel's with a prototype of the data form (values built as data); Fumola's. Time, and blocks allocated. ^report(29) already set the two evaluators side by side on eight small programs: Hazel took half Fumola's steps, and each cost about 20 times as much: 2.6 µs a pass against 0.13 µs a step. (Corrected 11-08, 08:33: this said about 15 times, from ^report(29)'s series card; its text says about 20.)
  3. Ids. Done 11-08 (below). How many fresh ids a run makes on the Witch slide, and what making them costs (^report(45) measured one id at a time; in ^report(29)'s profiles, fresh ids were 46% of one program's time); the first count of what reads a value's ids (above).
  4. Reading. Done 11-08 (below). A probe's drawer printing a sample: a term today; data turned into a term; data printed directly.
  5. Into JS. Done 11-08 (below), hazel-jit's trip in and Fumola's through fumola_wasm. The picture into a compiled view: from Hazel's terms (hazel-jit's trip in, ^report(45)), from data, and from Fumola's values through fumola_wasm.

Where they run: Hazel's in Node on GitHub's machines (the test build is too heavy for the laptop) and in the Firefox check; Fumola's on the laptop, from its own repo (a cold build is about 3 minutes). Each result goes into this report as it comes, with its commit and run.

Experiment 1: sending the Witch's picture#

As data, the Witch's picture is 3.0 times smaller than as Hazel's terms (48.0 KB against 142.2 KB), and its trip by Marshal, encoded and decoded, takes 4.38 to 7.28 ms against 15.0 to 25.7, 2.5 to 4.3 times less. As plain JS values it would cross by the browser's own copy in 0.58 to 1.09 ms, once made JS (0.61 to 0.81 ms), or as JSON in 0.54 to 1.28 ms both ways. Fumola, natively, reads the same picture from JSON into its Value in 1.04 ms.

The Witch's picture, sent asKBencode, msdecode, ms
Hazel's term, by Marshal (today)142.29.67 to 12.04.00 to 14.3
data, by Marshal48.03.12 to 5.201.25 to 2.08
data, by Marshal with no sharing table62.01.79 to 3.86larger: a string met twice is written twice
data made plain JS values, by structuredClone0.61 to 0.81 (made JS) + 0.58 to 1.09 (the copy)what postMessage does with JS values
data made plain JS values, as JSON66.30.61 to 0.81 (made JS) + 0.33 to 0.810.21 to 0.47
Fumola's Value, from JSON (json_in)44.31.04native, on the laptop
Fumola's Value, through its serde derive (JSON)113.80.270.99native, on the laptop; tagged, so wordier

Times in Firefox are ranges over the check's runs (42493347395, 42494174912, 42494936942, 42495801262); Firefox's clock there ticks in whole milliseconds, and each time is the median of five batches of at least 25 ms.

Where the bytes are: treemaps#

The picture's bytes as Hazel's terms and as data, drawn as treemaps: each rectangle's area is its bytes, each shape an outer rectangle split into what its bytes are. Treemaps are Ben Shneiderman's, from the University of Maryland's Human-Computer Interaction Lab (1991), made first to show where a disk's space goes; the layout here is the squarified one of Bruls, Huijsing and van Wijk (2000), which keeps rectangles near square so their sizes compare by eye. (Matthew, 2026-11-08: "I'd really like to see 'tree maps' as figures (2d, not 1d) ... for before and after the first-order representation is applied.")

The Witch's picture, its bytes as Hazel's terms and as data, on one scaleAs Hazel terms, today: 142.2 KBframe: term structure, 2,493 bytesframe: ids and tags, 1,140 bytesframe: data structure, 119 bytesframe: the data itself, 42 bytesframe: 3,794 bytesframehat: ids and tags, 1,074 byteshat: term structure, 922 byteshat: data structure, 893 byteshat: the data itself, 567 byteshat: 3,456 byteshathat: ids and tags, 1,028 byteshat: term structure, 865 byteshat: data structure, 836 byteshat: the data itself, 518 byteshat: 3,247 byteshatnose: ids and tags, 882 bytesnose: term structure, 755 bytesnose: data structure, 720 bytesnose: the data itself, 512 bytesnose: 2,869 bytesnoseskirt: ids and tags, 1,244 bytesskirt: term structure, 662 bytesskirt: data structure, 640 bytesskirt: the data itself, 317 bytesskirt: 2,863 bytesskirthand: ids and tags, 1,156 byteshand: term structure, 622 byteshand: data structure, 608 byteshand: the data itself, 458 byteshand: 2,844 byteshandlong top: ids and tags, 1,278 byteslong top: term structure, 642 byteslong top: data structure, 608 byteslong top: the data itself, 291 byteslong top: 2,819 byteslong tophand: ids and tags, 702 byteshand: term structure, 638 byteshand: data structure, 608 byteshand: the data itself, 456 byteshand: 2,404 byteshandneck: ids and tags, 1,778 bytesneck: term structure, 275 bytesneck: data structure, 205 bytesneck: the data itself, 94 bytesneck: 2,352 bytesneckhand: ids and tags, 702 byteshand: term structure, 638 byteshand: data structure, 608 byteshand: the data itself, 336 byteshand: 2,284 byteshandhand: ids and tags, 702 byteshand: term structure, 638 byteshand: data structure, 608 byteshand: the data itself, 336 byteshand: 2,284 byteshandlong: ids and tags, 974 byteslong: term structure, 502 byteslong: data structure, 440 byteslong: the data itself, 159 byteslong: 2,075 byteslongshirt: ids and tags, 1,213 bytesshirt: term structure, 386 bytesshirt: data structure, 300 bytesshirt: the data itself, 154 bytesshirt: 2,053 bytesshirteye: ids and tags, 644 byteseye: term structure, 531 byteseye: data structure, 497 byteseye: the data itself, 282 byteseye: 1,954 byteseyeeye: ids and tags, 627 byteseye: term structure, 528 byteseye: data structure, 515 byteseye: the data itself, 210 byteseye: 1,880 byteseyehead: ids and tags, 891 byteshead: term structure, 444 byteshead: data structure, 384 byteshead: the data itself, 157 byteshead: 1,876 bytesheadarm: ids and tags, 1,195 bytesarm: term structure, 200 bytesarm: data structure, 160 bytesarm: the data itself, 105 bytesarm: 1,660 bytesarmmouth: ids and tags, 512 bytesmouth: term structure, 436 bytesmouth: data structure, 406 bytesmouth: the data itself, 197 bytesmouth: 1,551 bytesmouthhat: ids and tags, 498 byteshat: term structure, 416 byteshat: data structure, 384 byteshat: the data itself, 245 byteshat: 1,543 byteshatwart: ids and tags, 499 byteswart: term structure, 417 byteswart: data structure, 384 byteswart: the data itself, 221 byteswart: 1,521 byteswartwart: ids and tags, 499 byteswart: term structure, 415 byteswart: data structure, 387 byteswart: the data itself, 208 byteswart: 1,509 byteswartwart: ids and tags, 499 byteswart: term structure, 415 byteswart: data structure, 389 byteswart: the data itself, 201 byteswart: 1,504 byteswartboot: ids and tags, 596 bytesboot: term structure, 334 bytesboot: data structure, 300 bytesboot: the data itself, 128 bytesboot: 1,358 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 297 bytesweb: the data itself, 156 bytesweb: 1,349 bytesweb: ids and tags, 577 bytesweb: term structure, 322 bytesweb: data structure, 301 bytesweb: the data itself, 145 bytesweb: 1,345 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 299 bytesweb: the data itself, 147 bytesweb: 1,342 bytesweb: ids and tags, 577 bytesweb: term structure, 322 bytesweb: data structure, 301 bytesweb: the data itself, 138 bytesweb: 1,338 bytesweb: ids and tags, 577 bytesweb: term structure, 322 bytesweb: data structure, 301 bytesweb: the data itself, 138 bytesweb: 1,338 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 297 bytesweb: the data itself, 142 bytesweb: 1,335 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 297 bytesweb: the data itself, 142 bytesweb: 1,335 byteswebweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 299 bytesweb: the data itself, 140 bytesweb: 1,335 byteswebweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 299 bytesweb: the data itself, 140 bytesweb: 1,335 byteswebweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 304 bytesweb: the data itself, 127 bytesweb: 1,327 byteswebboot: ids and tags, 594 bytesboot: term structure, 330 bytesboot: data structure, 304 bytesboot: the data itself, 95 bytesboot: 1,323 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 304 bytesweb: the data itself, 113 bytesweb: 1,313 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 304 bytesweb: the data itself, 113 bytesweb: 1,313 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 302 bytesweb: the data itself, 115 bytesweb: 1,313 bytesweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 302 bytesweb: the data itself, 115 bytesweb: 1,313 byteswebweb: ids and tags, 576 bytesweb: term structure, 320 bytesweb: data structure, 302 bytesweb: the data itself, 115 bytesweb: 1,313 byteswebhand: ids and tags, 382 byteshand: term structure, 359 byteshand: data structure, 329 byteshand: the data itself, 234 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 330 byteshand: the data itself, 234 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 330 byteshand: the data itself, 234 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 1,304 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 1,304 byteshandeye: ids and tags, 434 byteseye: term structure, 362 byteseye: data structure, 330 byteseye: the data itself, 169 byteseye: 1,295 byteseyehand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 329 byteshand: the data itself, 200 byteshand: 1,269 byteseye: ids and tags, 434 byteseye: term structure, 360 byteseye: data structure, 341 byteseye: the data itself, 127 byteseye: 1,262 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 179 byteshand: 1,247 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 1,244 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 162 byteshand: 1,230 byteshandhand: ids and tags, 382 byteshand: term structure, 358 byteshand: data structure, 328 byteshand: the data itself, 143 byteshand: 1,211 byteshandbuckle: ids and tags, 444 bytesbuckle: term structure, 211 bytesbuckle: data structure, 182 bytesbuckle: the data itself, 80 bytesbuckle: 917 bytesleg: ids and tags, 525 bytesleg: term structure, 191 bytesleg: data structure, 148 bytesleg: the data itself, 47 bytesleg: 911 bytesbuckle: ids and tags, 361 bytesbuckle: term structure, 211 bytesbuckle: data structure, 182 bytesbuckle: the data itself, 63 bytesbuckle: 817 bytesbuckle: ids and tags, 360 bytesbuckle: term structure, 208 bytesbuckle: data structure, 185 bytesbuckle: the data itself, 54 bytesbuckle: 807 bytesboot: ids and tags, 326 bytesboot: term structure, 194 bytesboot: data structure, 160 bytesboot: the data itself, 61 bytesboot: 741 byteshat: ids and tags, 256 byteshat: term structure, 211 byteshat: data structure, 182 byteshat: the data itself, 89 byteshat: 738 bytesbelt: ids and tags, 325 bytesbelt: term structure, 193 bytesbelt: data structure, 160 bytesbelt: the data itself, 57 bytesbelt: 735 bytesboot: ids and tags, 324 bytesboot: term structure, 190 bytesboot: data structure, 164 bytesboot: the data itself, 50 bytesboot: 728 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 160 bytesstocking: the data itself, 54 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 160 bytesstocking: the data itself, 54 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 160 bytesstocking: the data itself, 54 bytesstocking: 727 bytesstocking: ids and tags, 324 bytesstocking: term structure, 188 bytesstocking: data structure, 166 bytesstocking: the data itself, 48 bytesstocking: 726 bytesstocking: ids and tags, 327 bytesstocking: term structure, 190 bytesstocking: data structure, 160 bytesstocking: the data itself, 46 bytesstocking: 723 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 723 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 723 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 723 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 723 bytesstocking: ids and tags, 324 bytesstocking: term structure, 189 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 723 bytesleg: ids and tags, 324 bytesleg: term structure, 187 bytesleg: data structure, 166 bytesleg: the data itself, 46 bytesleg: 723 bytesstocking: ids and tags, 324 bytesstocking: term structure, 188 bytesstocking: data structure, 160 bytesstocking: the data itself, 46 bytesstocking: 718 bytesstocking: ids and tags, 313 bytesstocking: term structure, 185 bytesstocking: data structure, 158 bytesstocking: the data itself, 59 bytesstocking: 715 bytessleeve: term structure, 192 bytessleeve: ids and tags, 191 bytessleeve: data structure, 160 bytessleeve: the data itself, 108 bytessleeve: 651 bytessleeve: term structure, 192 bytessleeve: ids and tags, 191 bytessleeve: data structure, 160 bytessleeve: the data itself, 104 bytessleeve: 647 bytessleeve: term structure, 190 bytessleeve: ids and tags, 162 bytessleeve: data structure, 160 bytessleeve: the data itself, 81 bytessleeve: 593 bytessleeve: term structure, 190 bytessleeve: ids and tags, 162 bytessleeve: data structure, 160 bytessleeve: the data itself, 74 bytessleeve: 586 bytesarm: term structure, 182 bytesarm: data structure, 160 bytesarm: ids and tags, 155 bytesarm: the data itself, 81 bytesarm: 578 bytesweb: ids and tags, 200 bytesweb: term structure, 127 bytesweb: data structure, 98 bytesweb: the data itself, 64 bytesweb: 489 bytesstitching: ids and tags, 215 bytesstitching: term structure, 127 bytesstitching: data structure, 98 bytesstitching: the data itself, 44 bytesstitching: 484 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 98 bytesweb: the data itself, 49 bytesweb: 469 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 103 bytesweb: the data itself, 39 bytesweb: 464 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 100 bytesweb: the data itself, 42 bytesweb: 464 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 98 bytesweb: the data itself, 43 bytesweb: 463 bytes(the list itself): term structure, 269 bytes(the list itself): ids and tags, 116 bytes(the list itself): the data itself, 75 bytes(the list itself): 460 bytesbuckle: ids and tags, 199 bytesbuckle: term structure, 127 bytesbuckle: data structure, 98 bytesbuckle: the data itself, 35 bytesbuckle: 459 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 40 bytesweb: 458 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 40 bytesweb: 458 bytesweb: ids and tags, 197 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 37 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 127 bytesweb: data structure, 99 bytesweb: the data itself, 30 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 104 bytesweb: the data itself, 30 bytesweb: 454 bytesweb: ids and tags, 200 bytesweb: term structure, 122 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 98 bytesweb: the data itself, 34 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 100 bytesweb: the data itself, 34 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 101 bytesweb: the data itself, 33 bytesweb: 454 bytesweb: ids and tags, 200 bytesweb: term structure, 122 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 454 bytesweb: ids and tags, 198 bytesweb: term structure, 124 bytesweb: data structure, 98 bytesweb: the data itself, 34 bytesweb: 454 bytesweb: ids and tags, 203 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 30 bytesweb: 453 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 103 bytesweb: the data itself, 30 bytesweb: 453 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 103 bytesweb: the data itself, 30 bytesweb: 453 bytesweb: ids and tags, 200 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 33 bytesweb: 453 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 100 bytesweb: the data itself, 33 bytesweb: 453 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 100 bytesweb: the data itself, 33 bytesweb: 453 bytesweb: ids and tags, 200 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 33 bytesweb: 453 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 100 bytesweb: the data itself, 33 bytesweb: 453 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 102 bytesweb: the data itself, 30 bytesweb: 452 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 34 bytesweb: 452 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 452 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 33 bytesweb: 451 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 448 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 448 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 448 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 448 bytesweb: ids and tags, 197 bytesweb: term structure, 122 bytesweb: data structure, 98 bytesweb: the data itself, 30 bytesweb: 447 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 101 bytesweb: the data itself, 26 bytesweb: 447 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 101 bytesweb: the data itself, 26 bytesweb: 447 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 101 bytesweb: the data itself, 26 bytesweb: 447 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 101 bytesweb: the data itself, 24 bytesweb: 445 bytesweb: ids and tags, 198 bytesweb: term structure, 122 bytesweb: data structure, 99 bytesweb: the data itself, 26 bytesweb: 445 bytesAs data: 48.0 KB, 3.0 times smallerhat: data structure, 893 byteshat: the data itself, 567 byteshat: 1,460 byteshat: data structure, 836 byteshat: the data itself, 518 byteshat: 1,354 bytesnose: data structure, 720 bytesnose: the data itself, 512 bytesnose: 1,232 byteshand: data structure, 608 byteshand: the data itself, 458 byteshand: 1,066 byteshand: data structure, 608 byteshand: the data itself, 456 byteshand: 1,064 bytesskirt: data structure, 640 bytesskirt: the data itself, 317 bytesskirt: 957 byteshand: data structure, 608 byteshand: the data itself, 336 byteshand: 944 byteshand: data structure, 608 byteshand: the data itself, 336 byteshand: 944 byteslong top: data structure, 608 byteslong top: the data itself, 291 byteslong top: 899 byteseye: data structure, 497 byteseye: the data itself, 282 byteseye: 779 byteseye: data structure, 515 byteseye: the data itself, 210 byteseye: 725 byteshat: data structure, 384 byteshat: the data itself, 245 byteshat: 629 byteswart: data structure, 384 byteswart: the data itself, 221 byteswart: 605 bytesmouth: data structure, 406 bytesmouth: the data itself, 197 bytesmouth: 603 byteslong: data structure, 440 byteslong: the data itself, 159 byteslong: 599 byteswart: data structure, 387 byteswart: the data itself, 208 byteswart: 595 byteswart: data structure, 389 byteswart: the data itself, 201 byteswart: 590 byteshand: data structure, 330 byteshand: the data itself, 234 byteshand: 564 byteshand: data structure, 330 byteshand: the data itself, 234 byteshand: 564 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 564 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 564 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 564 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 564 byteshand: data structure, 328 byteshand: the data itself, 236 byteshand: 564 byteshand: data structure, 329 byteshand: the data itself, 234 byteshand: 563 byteshead: data structure, 384 byteshead: the data itself, 157 byteshead: 541 byteshand: data structure, 329 byteshand: the data itself, 200 byteshand: 529 byteshand: data structure, 328 byteshand: the data itself, 179 byteshand: 507 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteshand: data structure, 328 byteshand: the data itself, 176 byteshand: 504 byteseye: data structure, 330 byteseye: the data itself, 169 byteseye: 499 byteshand: data structure, 328 byteshand: the data itself, 162 byteshand: 490 byteshand: data structure, 328 byteshand: the data itself, 143 byteshand: 471 byteseye: data structure, 341 byteseye: the data itself, 127 byteseye: 468 bytesshirt: data structure, 300 bytesshirt: the data itself, 154 bytesshirt: 454 bytesweb: data structure, 297 bytesweb: the data itself, 156 bytesweb: 453 bytesweb: data structure, 301 bytesweb: the data itself, 145 bytesweb: 446 bytesweb: data structure, 299 bytesweb: the data itself, 147 bytesweb: 446 bytesweb: data structure, 301 bytesweb: the data itself, 138 bytesweb: 439 bytesweb: data structure, 301 bytesweb: the data itself, 138 bytesweb: 439 bytesweb: data structure, 297 bytesweb: the data itself, 142 bytesweb: 439 bytesweb: data structure, 297 bytesweb: the data itself, 142 bytesweb: 439 bytesweb: data structure, 299 bytesweb: the data itself, 140 bytesweb: 439 bytesweb: data structure, 299 bytesweb: the data itself, 140 bytesweb: 439 bytesweb: data structure, 304 bytesweb: the data itself, 127 bytesweb: 431 bytesboot: data structure, 300 bytesboot: the data itself, 128 bytesboot: 428 bytesweb: data structure, 304 bytesweb: the data itself, 113 bytesweb: 417 bytesweb: data structure, 304 bytesweb: the data itself, 113 bytesweb: 417 bytesweb: data structure, 302 bytesweb: the data itself, 115 bytesweb: 417 bytesweb: data structure, 302 bytesweb: the data itself, 115 bytesweb: 417 bytesweb: data structure, 302 bytesweb: the data itself, 115 bytesweb: 417 bytesboot: data structure, 304 bytesboot: the data itself, 95 bytesboot: 399 bytesneck: data structure, 205 bytesneck: the data itself, 94 bytesneck: 299 byteshat: data structure, 182 byteshat: the data itself, 89 byteshat: 271 bytessleeve: data structure, 160 bytessleeve: the data itself, 108 bytessleeve: 268 bytesarm: data structure, 160 bytesarm: the data itself, 105 bytesarm: 265 bytessleeve: data structure, 160 bytessleeve: the data itself, 104 bytessleeve: 264 bytesbuckle: data structure, 182 bytesbuckle: the data itself, 80 bytesbuckle: 262 bytesbuckle: data structure, 182 bytesbuckle: the data itself, 63 bytesbuckle: 245 bytesarm: data structure, 160 bytesarm: the data itself, 81 bytesarm: 241 bytessleeve: data structure, 160 bytessleeve: the data itself, 81 bytessleeve: 241 bytesbuckle: data structure, 185 bytesbuckle: the data itself, 54 bytesbuckle: 239 bytessleeve: data structure, 160 bytessleeve: the data itself, 74 bytessleeve: 234 bytesboot: data structure, 160 bytesboot: the data itself, 61 bytesboot: 221 bytesstocking: data structure, 158 bytesstocking: the data itself, 59 bytesstocking: 217 bytesbelt: data structure, 160 bytesbelt: the data itself, 57 bytesbelt: 217 bytesstocking: data structure, 166 bytesstocking: the data itself, 48 bytesstocking: 214 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 214 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 214 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 214 bytesstocking: data structure, 164 bytesstocking: the data itself, 50 bytesstocking: 214 bytesstocking: data structure, 160 bytesstocking: the data itself, 54 bytesstocking: 214 bytesstocking: data structure, 160 bytesstocking: the data itself, 54 bytesstocking: 214 bytesstocking: data structure, 160 bytesstocking: the data itself, 54 bytesstocking: 214 bytesboot: data structure, 164 bytesboot: the data itself, 50 bytesboot: 214 bytesleg: data structure, 166 bytesleg: the data itself, 46 bytesleg: 212 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 210 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 210 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 210 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 210 bytesstocking: data structure, 164 bytesstocking: the data itself, 46 bytesstocking: 210 bytesstocking: data structure, 160 bytesstocking: the data itself, 46 bytesstocking: 206 bytesstocking: data structure, 160 bytesstocking: the data itself, 46 bytesstocking: 206 bytesleg: data structure, 148 bytesleg: the data itself, 47 bytesleg: 195 bytesweb: data structure, 98 bytesweb: the data itself, 64 bytesweb: 162 bytesframe: data structure, 119 bytesframe: the data itself, 42 bytesframe: 161 bytesweb: data structure, 98 bytesweb: the data itself, 49 bytesweb: 147 bytesweb: data structure, 103 bytesweb: the data itself, 39 bytesweb: 142 bytesstitching: data structure, 98 bytesstitching: the data itself, 44 bytesstitching: 142 bytesweb: data structure, 100 bytesweb: the data itself, 42 bytesweb: 142 bytesweb: data structure, 98 bytesweb: the data itself, 43 bytesweb: 141 bytesweb: data structure, 98 bytesweb: the data itself, 40 bytesweb: 138 bytesweb: data structure, 98 bytesweb: the data itself, 40 bytesweb: 138 bytesweb: data structure, 98 bytesweb: the data itself, 37 bytesweb: 135 bytesweb: data structure, 104 bytesweb: the data itself, 30 bytesweb: 134 bytesweb: data structure, 100 bytesweb: the data itself, 34 bytesweb: 134 bytesweb: data structure, 101 bytesweb: the data itself, 33 bytesweb: 134 bytesweb: data structure, 103 bytesweb: the data itself, 30 bytesweb: 133 bytesweb: data structure, 103 bytesweb: the data itself, 30 bytesweb: 133 bytesweb: data structure, 100 bytesweb: the data itself, 33 bytesweb: 133 bytesweb: data structure, 100 bytesweb: the data itself, 33 bytesweb: 133 bytesweb: data structure, 100 bytesweb: the data itself, 33 bytesweb: 133 bytesbuckle: data structure, 98 bytesbuckle: the data itself, 35 bytesbuckle: 133 bytesweb: data structure, 102 bytesweb: the data itself, 30 bytesweb: 132 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 132 bytesweb: data structure, 98 bytesweb: the data itself, 34 bytesweb: 132 bytesweb: data structure, 98 bytesweb: the data itself, 34 bytesweb: 132 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 132 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 132 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 132 bytesweb: data structure, 99 bytesweb: the data itself, 33 bytesweb: 132 bytesweb: data structure, 98 bytesweb: the data itself, 34 bytesweb: 132 bytesweb: data structure, 98 bytesweb: the data itself, 33 bytesweb: 131 bytesweb: data structure, 98 bytesweb: the data itself, 33 bytesweb: 131 bytesweb: data structure, 98 bytesweb: the data itself, 33 bytesweb: 131 bytesweb: data structure, 99 bytesweb: the data itself, 30 bytesweb: 129 bytesweb: data structure, 98 bytesweb: the data itself, 30 bytesweb: 128 bytesweb: data structure, 98 bytesweb: the data itself, 30 bytesweb: 128 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 128 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 128 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 128 bytesweb: data structure, 102 bytesweb: the data itself, 26 bytesweb: 128 bytesweb: data structure, 101 bytesweb: the data itself, 26 bytesweb: 127 bytesweb: data structure, 101 bytesweb: the data itself, 26 bytesweb: 127 bytesweb: data structure, 101 bytesweb: the data itself, 26 bytesweb: 127 bytesweb: data structure, 101 bytesweb: the data itself, 24 bytesweb: 125 bytesweb: data structure, 99 bytesweb: the data itself, 26 bytesweb: 125 bytes(the list itself): the data itself, 75 bytes(the list itself): 75 bytesids and tagsterm structuredata structurethe data itself
Treemaps (Ben Shneiderman's, University of Maryland, 1991; the squarified layout of Bruls, Huijsing and van Wijk, 2000): each rectangle's area is its bytes. Each outer rectangle is one of the picture's shapes, named where it is large enough, and is split into what its bytes are; each amount a difference of exact Marshal sizes, taken shape by shape as each adds to the shapes before it, so the shapes add up to the whole and what they share (the types every constructor carries, a repeated string) is counted once, on the first shape that uses it (DataExperiment.tree). Firefox on GitHub's machines, run 42495801262 (480a30a8dd). Hover a rectangle for its bytes.

As Hazel's terms, the picture's ids and tags are 55.8 KB of its 142.2 KB (39%); the rest of the terms' structure 38.4 KB; the data's own structure 32.2 KB; and the data itself, its numbers and strings, 15.8 KB, 11% of the whole. As data, only the last two are left: 48.0 KB. Each amount is a difference of two exact sizes: the term against the same term with every id tag one shared tag; that against the data; the data against its numbers and strings alone; each taken for the picture's 133 shapes in turn, as each adds to those before it. The first shape, the frame, carries the types every shape's constructor shares, so it is large as a term and nearly nothing as data.

Experiments 3, 4 and 5: ids, reading, and into JS#

Data pays most at the edges: printing the Witch's picture as data takes 1.83 to 2.03 ms against 91.8 to 110.3 ms as a term, 50 to 54 times less, and sending it 2.5 to 3.9 times less (experiment 1); carrying it into JS takes about the same either way (1.0 to 1.1 times). Inside the run, minting ids is a small part: a run mints 188,718 to 189,922 ids, 12 to 14 ns each, about 2.2 to 2.6 ms, 0.2 to 0.3% of the evaluator's 0.84 to 1.00 s. (Matthew, 2026-11-08: "push on this".) The same check as experiment 1, on the Witch slide's small edits: the id counts from run 42504537594 (e69234eb95), the times from runs 42536466518, 42537027939 (e1967c3a40), each the median of five batches of at least 300 ms. (Corrected 11-08, 16:58: this section first gave an id as 157 ns to mint, so minting 3.0 to 3.6% of the evaluator, and the trip into JS as 1.4 times quicker from data. Those were timed in batches of 25 ms, which one garbage collection of the page's heap can fill, and two later runs timed that way disagreed by up to five times (experiment 2). Timed in batches of at least 300 ms, an id is 12 to 14 ns, minting is 0.2 to 0.3% of the evaluator, and into JS is about the same either way. Printing held: 50 to 54 times quicker as data, 38 before.)

Experiment 2, a first slice: building the picture#

Building values as data would save the evaluator a couple of percent at most. Built node by node, the Witch's picture takes 0.94 to 1.34 ms as Hazel's terms with a fresh id on every node, 0.30 to 0.34 ms as terms with no id minted, and 0.31 to 1.38 ms as data, about what terms with no ids cost. An id with its tag, kept in a tree, costs 59 to 91 ns a node; a run mints 188,718 to 189,922, so 11 to 17 ms, 1.0 to 2.5% of the evaluator's 0.68 to 1.08 s. The evaluator's time is its own work, not the values it builds: to reach 60 fps the run itself has to be compiled (^ticket(722)). The same check, on the Witch slide (e1967c3a40; runs 42536466518, 42537027939), each time the median of five batches of at least 300 ms.

(Before publishing, 11-08: a first draft of this experiment put the ceiling at 17 to 36% of the evaluator. It was timed in batches of 25 ms, and a second run of the same commit timed terms with no ids as 3 times slower than with fresh ids, which no cost explains: a 25 ms batch is shorter than one garbage collection of the page's heap, so a batch holding one reads several times too slow (runs 42535123022, 42535708383). Experiments 2 to 5 are now timed in batches of at least 300 ms, which spreads a collection over the calls that cause it, and every batch's time is kept. Experiment 1's times were taken in 25 ms batches too; over its runs they agreed in direction, and they are next to be timed again.)

The plan for the group#

Written from the experiments, for the group: which form, which edges first, and what each costs and saves, as measured. What they say so far (11-08): the data form pays at the edges, 2.5 to 3.9 times quicker to send, 50 to 54 times quicker to print, and needs only one shared conversion back to a term on dev (what reads a value's ids); inside the evaluator, building values as data saves a couple of percent at most, ids and tags and all (experiment 2's first slice), so the 60 fps goal needs the run itself compiled (^ticket(722); ^report(46), compiling the run) or made incremental. The data form is for the edges: what the worker sends, and what the page prints.

At the edges it did what the experiments said, on the livelits branch (trial/694-view-jit, the Witch slide in Firefox, ^report(51), builds 19 and 20). Weighed by part, the worker's answer was 590 KB, 112 KB of it a final stream the page set aside on arrival, now not sent; the result's first-order sample values, 17 a result, its picture among them, now go as data and are made terms again in the page, and none has come back different. The answer is 198 KB; the worker's encoding 21 to 29 ms, from 72 to 107; the page's decoding 7 to 8 ms, from 24 to 31. What is new is the two conversions, as slices 2 and 3 below expect: 29 to 41 ms in the worker making the data, a check of each value's way back included, and 6 to 17 ms in the page making terms again. Both go when samples are made as data and the page draws data. The first try, on build 11, made the answer larger (0.89 MB): it rebuilt the samples of the 216 cached states its messages carried, and lost the sharing among them; with no final stream, only the result's own 108 samples are rebuilt. A draft of the slices:

  1. Data, of_term and to_term, with the round-trip tests and the list of what reads a value's ids on dev (above), and a Node benchmark on dev: a program whose probes name a module and a list of a thousand records, its worker answer's bytes and its encode and decode time, as terms and as data (each way of sending, above).
  2. Probe samples as data: the sample's value and environment; the drawer draws data. Measured with that benchmark and on dev's deploy in Firefox. (Tried at the edges on the livelits branch, above: made data where the answer is sent and terms where it arrives.)
  3. The worker's messages: the value and the cache's states, and the way of sending the first slice found fastest. (On the branch, results only: a result carries one state, and a stream's many cached states share their samples, which rebuilding them lost.)
  4. The Data term in the evaluator: values built as data; the matcher, the builtins, equality and printing.
  5. The livelits branches: models and livelit samples as data, and hazel-jit's trip; measured on the Witch's small edits (1.9 to 2.4 s when this note was begun, two cuts; on the branch now, a step shows in 19 to 24 ms with the run compiled, and the probes' answer is the edge left, ^report(51)).

Questions for Matthew#

  1. The name: Data, or something else?
  2. Lists: an OCaml list, cheap to cons; an array, cheap to send and to index; a persistent vector, as Fumola's arrays are; or a level tree, as ^ticket(710) asks?
  3. Is the evaluator's form (slice 4) in scope from the start, or the edges first, as here? And is a separate value type, as Fumola has, worth weighing instead?
  4. Constructors' types: carried once at the root, as here, or not at all, the statics finding them again?

How this was put together#