Hazel reports · ^report(51) · hazel-jit · 2026-11-09, revised 2026-11-17 16:23 MST · work in progress · for colleagues, and their agents

Hazel-JIT Status Report

hazel-jit compiles Hazel to JavaScript, and the browser runs it. What does it gain, and what does it cost? How can you use it in your own PR today? What has been added since its first version, three days ago? And what does it not do yet? Matthew, 2026-11-09: "a report for my colleagues to read (or have their agents read)". Everything here is on one branch, trial/694-view-jit (hazelgrove/hazel#2817), and every number names the build or the program it was measured on.

Try it in your browser. The Witch slide, compiled, with a frame-rate overlay at top right; and the same with nothing compiled. Drag a slider and watch the picture. Every slide of the Livelit Playground is linked the same way in hazelgrove/hazel#2819, which hosts this build (the branch at 61f3f01a15, build 8 of ^report(50)).

2026-11-17: that build is from 2026-11-09. The current one is build 49, at build.hazel.org/trial/694-view-jit/ (the Witch, compiled, with the overlay); see the update below the outline.

Outline#

  1. What hazel-jit is: a compiler from Hazel's elaborated terms to the source of a JavaScript function, with what carries values across and draws its answers: 3,150 lines of Reason in four modules.
  2. Expected gains: compiled code runs 13 to 1,140 times faster than the interpreter; in the app, on today's build, a slider's step shows in the picture 19 to 24 ms after the click (it was 4.17 to 6.52 s before hazel-jit ran the slide), and a drag runs at about 60 frames a second, 171 of its 173 frames within one.
  3. Expected costs: compiling a livelit's definition takes about a millisecond, the largest about 20 ms, and a whole slide's program 87 to 299 ms (median 153), once; loading the slides with many livelits is no slower.
  4. How to use it in your own PR: base your branch on trial/694-view-jit, and livelits compile with no change; the API, the command line, the tests and the Firefox check, for anything else.
  5. What has been added since the first version: 133 commits in three days, from a term compiled in a test to a slide's whole run compiled in the page.
  6. Limitations: JavaScript's numbers, no probes inside compiled code, the forms it does not compile, one browser, and not on dev.
  7. Next steps, ongoing now: the five changes under way today, in Matthew's order, and what each would take away; and how this was put together.

Update, 2026-11-17: hazel-jit has moved on since this report; read the current reports. ^report(55), Where hazel-jit stands, is the place to start: the live build, what compiles and what does not, the open PRs and branches, and working with CI, as of 2026-11-17. ^report(54) has the story since this one, after Matthew and Cyrus's meeting of 2026-11-13: compiled code checked against the interpreter in CI on 313 programs, exact integers, errors, mixed mode, and the questions for the team. This report's How to use it in your own PR is still right about the setting, the OCaml calls, the command line, the tests and the Firefox check, except that hazelgrove/hazel#2819 no longer hosts the same build, and the results it quotes are build 8's.

What hazel-jit is#

hazel-jit turns an elaborated Hazel term, the same term the interpreter runs, into the source text of a JavaScript function; the browser's own engine makes it a function with new Function and runs it. It compiles once, and runs as often as it is called. Where it meets a form it does not compile, it says why, and that code runs on the interpreter instead: nothing is compiled wrongly to stay fast.

ModuleWhat it doesLines
src/language/dynamics/HazelJit.reThe compiler: a term to JS source (compile_full, try_compile), and its runtime, $R (structural equality, builtins, parameters and samples).1,070
src/language/dynamics/HazelJitValue.reThe boundary: Hazel values into JS (to_js) and back (of_js, read by the types the compiler recorded), a livelit definition compiled and its view and update called (view_of_def, call_view, call_update), and the counts and timings the Firefox check reads.812
src/language/dynamics/HazelJitRun.reA slide's whole run, compiled, with each livelit's model a parameter (^report(49)).797
src/haz3lcore/projectors/HazelJitDOM.reA view's answer drawn straight from its JS, without carrying it back into Hazel first.471

Values in JS: numbers are JS numbers; a list is cons cells, {h, t}, with null for the empty list; a tuple is an array, each label also a property; a constructor is {c: "Name", v: payload}; a function is a JS function of one argument; a module is a labelled value of its members. Types, ascriptions and parentheses are erased. ^report(45) has the details (how it works).

Expected gains#

The same Hazel code runs 13 to 1,140 times faster compiled than on Hazel's interpreter, on every program measured so far. The gain is largest for small pure computations (a recursive sum, 1,140 times), smaller where values cross into JS and back (a Polygons render, 40 times warm), and in between for a whole slide's run (the Witch, 106 to 119 times). In Firefox, in the app, on build 8: the Witch's picture view takes 1.5 ms compiled against 64 ms on the interpreter, and its polygon editors' views 0.12 to 0.25 ms against 17 to 35 ms.

The same Hazel code on Hazel's interpreter (grey) and as hazel-jit's JavaScript (teal); a log scaleA recursive sum of 1,000 numbersNode, report 045A recursive sum of 1,000 numbers: 47.9 to 47.9 msA recursive sum of 1,000 numbers: 0.042 to 0.042 msabout 1,140 timesThe Petri net rule, four eventsNode, report 045The Petri net rule, four events: 7.19 to 7.19 msThe Petri net rule, four events: 0.011 to 0.011 msabout 654 timesThe Witch's whole runNode, report 045The Witch's whole run: 502 to 529 msThe Witch's whole run: 4.2 to 5 msabout 112 timesA Polygons render, warm, with its tripNode, report 045A Polygons render, warm, with its trip: 13.7 to 13.7 msA Polygons render, warm, with its trip: 0.34 to 0.34 msabout 40 timesA Polygons render, its first 30 callsNode, report 045A Polygons render, its first 30 calls: 13.7 to 13.7 msA Polygons render, its first 30 calls: 1.03 to 1.03 msabout 13 timesThe Witch's polygon editors' views, drawnFirefox, build 8The Witch's polygon editors' views, drawn: 17 to 35 msThe Witch's polygon editors' views, drawn: 0.12 to 0.253333 msabout 140 timesThe Witch's picture view, drawnFirefox, build 8The Witch's picture view, drawn: 64 to 64 msThe Witch's picture view, drawn: 1.5 to 1.5 msabout 43 times16.7 ms, a 60 fps frame10 µs0.1 ms1 ms10 ms0.1 s1 s
Each row is one piece of Hazel code run two ways. The rows marked Node are not builds of the app: medians of 30 runs in Node 22 on a laptop, from ^report(45). The rows marked build 8 (61f3f01a15, run 42566328043) are in Firefox in the app: each view as the page runs it, the model in, the call and its drawing, against the interpreter's evaluation and drawing, timed again in the page (globalThis.hazelJit.bench, medians of 15). A drawn view's time is as if updating the state were free. The ratio is of the middles of the ranges.

In the app, the gains reach the user: on build 12, today's, a click on one of the Witch's sliders shows in the picture 19 to 24 ms later, and a drag runs at 57.6 frames a second, 171 of its 173 frames within one 60 fps frame. On the Witch slide (2,222 lines of Hazel, 53 livelits), a step took 4.17 to 6.52 s on build 1, with nothing compiled in the run, and 176 to 290 ms on build 8, ^report(50)'s last; a drag ran at 9.8 frames a second on build 5 and 48.4 on build 8. Build 12 draws a step from the compiled run's answers first and makes the edit of the program after the paint, and its drag frames reuse each editor's decorations, so the page's view is 6.1 ms a frame, against 10.1 on build 8. (The first of build 12's four steps took 124 ms; and one run's frames a second can differ from the next by a third, so the view's time per frame is the steadier measure.) Build 13 takes the sidebar's outline out of the page's view and builds it on its own after the paint (36 to 60 ms, two or three times a step), so the whole view after each of the worker's messages is 45 to 63 ms, against 88 to 130 ms on build 12, and a drag's view is 4.9 ms a frame. A step on build 13 shows in 24 ms twice, 51 ms on the first step of the arms slider (whose first view took 17 ms; no outline was built before its picture), and 72 ms the first time. Build 14 takes on the page's work after a step, as the check names it now (each projector drawn, with why, and each action): on machines of the same speed (the worker's encode 68 to 88 ms on both), that work, the autosave left out, is 0.37 to 0.52 s on build 14 against 0.56 to 0.92 s on build 13. The probe on the Witch's whole picture (^^probe(drawn)) drew its row in 44 to 91 ms after each worker answer, rewriting the whole 134 KB value before abbreviating it; on build 14, 8 to 21 ms. And the worker's reuse plan and first stream, which restated what the compiled run had drawn, no longer cost the page a calculate and a whole view: they wait for the result. (So the autosave, a second after the last action, now falls before the result rather than after it: 48 to 58 ms, the same work moved.) Build 15 keeps the livelits an edit does not touch: the view after a step's edit drew all 53 again, as the statics map was new, though 51 had their own statics record unchanged; keyed on that record, the livelits in that view take 2 to 3 ms, against 9 to 14 ms on build 14, and the page's work after steps 2 to 4 is 0.35 to 0.46 s (one run, a machine like build 14's). On a machine like build 13's, build 15 shows a step in 16 to 20 ms, and the page's work after steps 2 to 4 is 0.24 to 0.30 s, against 0.43 to 0.60 s on build 13; a drag runs at 58.6 frames a second, 173 of its 177 frames within one 60 fps frame, the page's view 4.4 ms a frame. (One run each.) The autosave is a cost to look at next: a second after each step's edit it takes 37 to 46 ms, 27 to 36 of them printing the whole program (2,222 lines) again for the slide's text; its first time after the slide loads it took 287 ms, and on one run of build 15 it came just as the first step did, which then showed in 443 ms. And it cost more than itself: it went through the update, whose wrappers made a new model, so each autosave was followed by a calculate (11 ms), a whole view (25 ms) and the outline built again (20 to 30 ms), though it changed nothing. Build 16 takes the autosave out of the update: the same model comes back, and nothing follows it. Build 17 takes on the comparison after the paint, which checks that the program is still the one the slide's run was compiled from, but for its livelits' models: it copied the whole program with the models left out and walked both copies, 33 to 43 ms a step, though after a step the new program is the old one's very objects but for 36 to 49 nodes. Remembered per node, the copy now touches only those, and the walk stops where the copies are the same objects: 1 ms, the run kept at every step as before. And build 18 makes the first step like the others: the compiled run compares each livelit's answer with the run before to draw again only those that changed, and before the first step there was no run before, so all 53 were drawn again (the first view 65 ms). A run right after the compilation, kept only for that comparison, takes its place: the first step's view 26 ms, its picture 92 ms, from 132. Build 19 takes on what the worker's answer costs the page, a second or two after the picture. Every answer is new objects, and two caches keyed on them by identity: the outline on the run's test results (a new record each time, tests or none), so it was built again after every answer (59 to 82 ms) and then the whole page redrawn to show it; and every livelit on the whole new dynamics map, so all 56 projectors were drawn again. The outline now keys the results by each test's status, and a livelit records what its drawing read of the run (its own samples, those it looked up, its pinned interval) and is kept while those are the same by value; its handlers act on the newest. After each answer 4 projectors are drawn (the edited livelit, one with splices, the two probes), the outline is the one before, and the page's work after a step is 0.31 to 0.40 s, against 0.34 to 0.55 s on build 18 (one run each, build 19's machine a little slower). Left of the outline: its build after the edit itself, 55 to 70 ms, though its entries are the same; keying it on its rows needs its handlers to act on the newest program, and blank bodies, refusals and the livelits' rows in the key. Build 20 takes on the answer itself, 590 KB a step: weighed by part, 112 KB of it was the last item's final stream, the cache's entries finished since the last stream (216 states, each with every probe so far), which the page decoded and merged only to drop, as a result sets the streamed outbox aside; the rest was the result's own probes, 108 samples, among them the picture (about 140 KB as a term) reached from several. The result goes without that stream (475 KB), and its first-order sample values go as data, as ^report(47) measured them (17 values a result, none different when made terms again on the page): the answer is 198 KB, the worker's encode 21 to 29 ms (against 72 to 107 ms) with 29 to 41 ms making the data, a check of each value's way back included, and the page's decode 7 to 8 ms (against 24 to 31 ms) with 6 to 17 ms making the values terms again. The page's work after a step is 0.21 to 0.32 s. Next for the values: make them data where samples are made, in the worker, and keep them data on the page, which would take away both conversions (^ticket(718), waiting on ^report(47)'s questions). Build 21 only times the parts of three costs. Making the data is FirstOrder.of_term, 16 to 50 ms in the worker, and the check of each value's way back, 13 to 64 ms, which runs only while the check records; making terms on the page is to_term, 5 to 10 ms. The outline drawn again after the edit, 42 to 53 ms, is mostly finding which of its rows open no cell, 32 to 40 ms (the rows themselves about 8). The autosave, 38 to 67 ms, is mostly printing the whole program for the slide's text, 25 to 48 ms, though a step changes one item. Build 22 takes on the outline's: for each of the 53 livelits, finding the rows that open no cell searched from the program's root for the livelit's path, which it reads only for a row inside one, and there are none; made lazy, the answers are the same and it takes 25 to 29 ms. Build 23 takes on the autosave's: the program's text is its top-level pieces' texts joined, so each piece's text is kept by the piece's identity and only the item a step changed is printed again (the whole program when a probe wraps a top-level piece or the probes changed; a test checks the text is the whole print's). Printing takes 3 to 6 ms, and the autosave 21 to 31 ms. Build 24 goes back to the outline: the walk asked whether each tile was a row, twice, a lookup in a map of ids, before its cheap tests; asked last, it asks 6,753 times of 43,171 pieces walked, and takes 11 to 14 ms, so the outline drawn after an edit is 29 to 32 ms, from 42 to 53 on build 21. (One run each, on GitHub's machines, which differ: build 23's ran slower throughout, its drag's view 8.0 ms a frame against 6.4 on builds 21 and 22 and 6.9 on build 24.)

Builds 25 and 26 take on the page's work when the worker's answer arrives, 92 to 116 ms on build 24. Build 25 only times the cell's work out of its syntax, which runs twice there, before and after the cell takes the answer's samples: it is all the syntax cache, 9 to 26 ms the first time, when the samples are not yet new, and 9 to 16 the second. Build 26 takes on the picture's probe row, 15 to 35 ms: to grey out a sample that is not a value, it ran the evaluator's step rules over the whole picture. Plain data (literals, labels, constructors, and lists, tuples and constructor applications of them) is a value exactly when its parts are, so its shape answers now, and the step rules only anything else (its test first compiled on build 30, where it passes). The row is 3 to 6 ms, and the page's view at the answer 31 to 64 ms, from 50 to 75 on build 24. Its new mark shows the next cost there: at each answer the views of all 53 livelits are made again, 16 to 41 ms, though only 2 are drawn.

At the worker's answer, builds 27 to 33 brought the page's redraw down to what changed: the projectors' views there take 11 to 16 ms, from 16 to 41 on build 26, and the whole view about 30 to 35 ms, from 36 to 60 on build 31. Build 27 names why each calculate's syntax cache worked the projectors' shapes out again: at the answer, the first time because the probes' list was a new object, though no probe had changed. Build 28 counts the livelits' views made again there, 16 to 22 ms: the view cache comparing 104 sample values by value, 2 to 8 ms, and wrapping the views it gave back, 10 to 12. Build 29 keeps the probes' list when a calculate removes no probe, which is nearly always: at the answer the first syntax pass takes 0 ms (8 to 19 on build 27), and the cell's calculate 10 to 15 ms (15 to 43 on build 26). Build 30 keeps a livelit's finished views when its view comes back from the cache the very same, for the same place, status and shape: 51 of the 53 keep them at each answer, and the same shapes keep the splice map. Build 31 keeps a livelit's shape by its definition and its model's value, not by the sample's number, which each run of the worker counts afresh, and a projector list equal to the one an editor last drew with stands for it: the 51 keep their views in the redraw after the edit too, and no shape function is evaluated at all. Build 33 keeps the sidebar's problem list at an answer, 2 to 3 ms (3 to 29 on build 31). Left at the answer, from build 35: the projectors' views 8 to 15 ms, the probes' views 7 to 9, the projector data 4 to 5, the sidebar 3 to 4; and once a step 20 to 35 ms somewhere else each time (the syntax pass, one livelit drawn, the decorations), most likely the browser collecting the answer's garbage, which the page cannot time.

A drag got slower twice on the way, and is now faster than on build 30: 6.3 ms a frame on build 38, against 8.2. Build 31's shape check, keyed on a livelit's definition, made a drag 15.1 ms a frame (its projectors' views 12.0, from 3.9): a use with arguments, like ^slider(..), had its livelit applied to them anew at each lookup, so the check found an equal copy each time and compared it node by node. Build 32 keeps a use's applied livelit while its livelit, type and arguments are the same; its drag was 5.4 ms a frame, but that drag did less than the others (with the compiled run off it was as fast, 5.5, where builds 30 and 34 take 15.3 and 15.0, and it compared no model value), so 5.4 is not a mark to hold the others to. Its memo held 16 uses of a livelit and emptied itself when full, and the Witch uses ^slider 29 times and ^choice 18, so build 33 holds 64. Build 33's drag was 16.1 ms a frame: the shape cache compared a livelit's model value at every frame, 8 to 13 ms for one of them (why build 32's drag compared none is not known). Only a shape that is a function of the model reads it, and none on the Witch is, so build 34 keeps a shape that does not read its model by its definition alone: 7.0 ms a frame, and at the answer the cell's calculate 7 to 8 ms (its shapes 17 to 50 on build 33).

After an edit, builds 36 to 39 bring the page's work after the picture to 167 to 183 ms at steps 2 to 4, from 206 to 215 on build 35 and 236 to 300 on builds 25 to 34; the edit's own work after the paint is now the larger part of it. Build 36: the outline, drawn again after each edit with its entries the same, walked all 43,171 pieces to find which rows open no cell, 10 to 11 ms; kept per top-level tile while the rows wanted are the same, that walk takes 0 to 2 ms, and the outline 18 ms (25 to 27). Build 37 keys a probe's view on its own statics record, as a livelit's is, since a probe reads neither another id's statics nor its elaborated term: after an edit no probe is drawn again, and the view takes 31 to 43 ms (37 to 62). Build 38: a view cache hit whose reads are equal by value takes the new map, so after an edit the livelits' 100 to 102 sample values are not compared again (2 to 5 ms). Its first run landed on a slower machine (the worker's encode 32 to 36 ms against 25 to 31, the slide's run 260 ms against 176) and read slower throughout; its second, on a machine like build 37's, is the one plotted. Build 39 keeps each projector's check for a statics error in its own hidden syntax by the syntax and the statics map: at the answer the projectors' data takes 0 to 1 ms (4 on build 38), and 3 to 6 after an edit. Left after an edit: the update that makes it, 16 ms; the statics, 16 to 20; the syntax cache, 11 to 12, which are the editor's core; the view, 31 to 43; and the outline, 18, on its own.

(A correction: builds 26 to 29's tests did not compile. The Witch check builds only the app, so it passed; CI's checks failed, and build 30 fixed the tests, which pass. Build 32's full tests ran past CI's 100 minutes; build 34's, with the same code and more, passed in 57. Builds 35 to 38 were tried on a branch of their own, trial/694-view-jit-35, so that a push would not cancel build 34's CI.)

The Witch, builds 8 to 39: a step, from the click to the picture (left, log scale), and a drag's frame, the page's view (right)8 · change C (report 050's last)build 8: a step, 290 msbuild 8: a step, 182 msbuild 8: a step, 176 msbuild 8: a step, 222 msthe editors: 8.3 msthe rest of the view: 1.8 ms10.1 ms · 48.4 fps9 · steps 3 and 4build 9: a step, 374 msbuild 9: a step, 210 msbuild 9: a step, 204 msbuild 9: a step, 234 msthe editors: 7.1 msthe rest of the view: 1.5 ms8.6 ms · 54.3 fps10 · the comparison after the paintbuild 10: a step, 398 msbuild 10: a step, 216 msbuild 10: a step, 208 msbuild 10: a step, 183 msthe editors: 7.9 msthe rest of the view: 1.9 ms9.8 ms · 47.8 fps11 · samples as databuild 11: a step, 284 msbuild 11: a step, 195 msbuild 11: a step, 152 msbuild 11: a step, 159 msthe editors: 6.8 msthe rest of the view: 1.4 ms8.2 ms · 56.3 fps12 · steps 2 and 1build 12: a step, 124 msbuild 12: a step, 19 msbuild 12: a step, 20 msbuild 12: a step, 24 msthe editors: 4.5 msthe rest of the view: 1.6 ms6.1 ms · 57.6 fps13 · the outline on its ownbuild 13: a step, 72 msbuild 13: a step, 24 msbuild 13: a step, 51 msbuild 13: a step, 24 msthe editors: 3.9 msthe rest of the view: 1.0 ms4.9 ms · 57.6 fps14 · the page after a stepbuild 14: a step, 131 msbuild 14: a step, 28 msbuild 14: a step, 25 msbuild 14: a step, 73 msthe editors: 5.9 msthe rest of the view: 1.6 ms7.5 ms · 52.0 fps15 · livelits kept across an editbuild 15: a step, 126 msbuild 15: a step, 20 msbuild 15: a step, 17 msbuild 15: a step, 16 msthe editors: 3.4 msthe rest of the view: 1.0 ms4.4 ms · 58.6 fps16 · the autosave on its ownbuild 16: a step, 124 msbuild 16: a step, 37 msbuild 16: a step, 29 msbuild 16: a step, 21 msthe editors: 5.9 msthe rest of the view: 1.5 ms7.4 ms · 51.7 fps17 · the comparison, only what changedbuild 17: a step, 132 msbuild 17: a step, 28 msbuild 17: a step, 35 msbuild 17: a step, 42 msthe editors: 6.8 msthe rest of the view: 1.8 ms8.6 ms · 45.7 fps18 · the first step like the othersbuild 18: a step, 92 msbuild 18: a step, 33 msbuild 18: a step, 37 msbuild 18: a step, 20 msthe editors: 5.2 msthe rest of the view: 1.4 ms6.6 ms · 55.7 fps19 · the page after an answerbuild 19: a step, 98 msbuild 19: a step, 28 msbuild 19: a step, 26 msbuild 19: a step, 27 msthe editors: 6.1 msthe rest of the view: 1.5 ms7.6 ms · 51.0 fps20 · the answer as databuild 20: a step, 40 msbuild 20: a step, 22 msbuild 20: a step, 20 msbuild 20: a step, 20 msthe editors: 4.5 msthe rest of the view: 1.4 ms5.9 ms · 55.6 fps21 · the parts timedbuild 21: a step, 77 msbuild 21: a step, 24 msbuild 21: a step, 29 msbuild 21: a step, 17 msthe editors: 5.2 msthe rest of the view: 1.2 ms6.4 ms · 56.3 fps22 · refusals, paths when askedbuild 22: a step, 106 msbuild 22: a step, 30 msbuild 22: a step, 25 msbuild 22: a step, 26 msthe editors: 4.9 msthe rest of the view: 1.5 ms6.4 ms · 55.4 fps23 · the autosave, only what changedbuild 23: a step, 90 msbuild 23: a step, 50 msbuild 23: a step, 30 msbuild 23: a step, 23 msthe editors: 6.2 msthe rest of the view: 1.8 ms8.0 ms · 46.8 fps24 · refusals, asked lastbuild 24: a step, 88 msbuild 24: a step, 26 msbuild 24: a step, 25 msbuild 24: a step, 25 msthe editors: 5.5 msthe rest of the view: 1.4 ms6.9 ms · 54.3 fps25 · the answer's syntax timedbuild 25: a step, 120 msbuild 25: a step, 25 msbuild 25: a step, 25 msbuild 25: a step, 22 msthe editors: 5.1 msthe rest of the view: 2.0 ms7.1 ms · 56.0 fps26 · plain data is a valuebuild 26: a step, 85 msbuild 26: a step, 23 msbuild 26: a step, 29 msbuild 26: a step, 25 msthe editors: 6.9 msthe rest of the view: 1.9 ms8.8 ms · 51.0 fps27 · the syntax cache's path namedbuild 27: a step, 59 msbuild 27: a step, 34 msbuild 27: a step, 25 msbuild 27: a step, 28 msthe editors: 4.7 msthe rest of the view: 1.3 ms6.0 ms · 56.7 fps28 · the kept livelits countedbuild 28: a step, 92 msbuild 28: a step, 25 msbuild 28: a step, 24 msbuild 28: a step, 21 msthe editors: 5.1 msthe rest of the view: 1.4 ms6.5 ms · 56.4 fps29 · the probes' list keptbuild 29: a step, 43 msbuild 29: a step, 58 msbuild 29: a step, 28 msbuild 29: a step, 22 msthe editors: 4.4 msthe rest of the view: 1.3 ms5.7 ms · 58.0 fps30 · kept livelits keep their wrappersbuild 30: a step, 93 msbuild 30: a step, 25 msbuild 30: a step, 27 msbuild 30: a step, 21 msthe editors: 6.1 msthe rest of the view: 2.1 ms8.2 ms · 51.7 fps31 · shapes by value, an equal projector listbuild 31: a step, 123 msbuild 31: a step, 24 msbuild 31: a step, 29 msbuild 31: a step, 21 msthe editors: 13.7 msthe rest of the view: 1.4 ms15.1 ms · 39.2 fps32 · a use's applied livelit keptbuild 32: a step, 41 msbuild 32: a step, 38 msbuild 32: a step, 31 msbuild 32: a step, 22 msthe editors: 4.2 msthe rest of the view: 1.2 ms5.4 ms · 58.3 fps33 · the memo holds 64, the sidebar's problems keptbuild 33: a step, 70 msbuild 33: a step, 29 msbuild 33: a step, 25 msbuild 33: a step, 21 msthe editors: 14.7 msthe rest of the view: 1.4 ms16.1 ms · 38.1 fps34 · a shape kept by its definition when it does not read the modelbuild 34: a step, 96 msbuild 34: a step, 26 msbuild 34: a step, 23 msbuild 34: a step, 21 msthe editors: 5.5 msthe rest of the view: 1.5 ms7.0 ms · 55.0 fps35 · the shapes timed per callbuild 35: a step, 77 msbuild 35: a step, 25 msbuild 35: a step, 21 msbuild 35: a step, 18 msthe editors: 6.4 msthe rest of the view: 1.7 ms8.1 ms · 52.7 fps36 · the outline's refusals kept per top-level tilebuild 36: a step, 99 msbuild 36: a step, 21 msbuild 36: a step, 25 msbuild 36: a step, 21 msthe editors: 5.1 msthe rest of the view: 1.5 ms6.6 ms · 55.0 fps37 · a probe kept by its own staticsbuild 37: a step, 75 msbuild 37: a step, 19 msbuild 37: a step, 19 msbuild 37: a step, 26 msthe editors: 4.1 msthe rest of the view: 1.1 ms5.2 ms · 57.6 fps38 · a cache hit on equal reads takes the new mapbuild 38: a step, 78 msbuild 38: a step, 31 msbuild 38: a step, 20 msbuild 38: a step, 20 msthe editors: 4.9 msthe rest of the view: 1.4 ms6.3 ms · 55.7 fps39 · a projector's hidden-syntax error check keptbuild 39: a step, 96 msbuild 39: a step, 22 msbuild 39: a step, 24 msbuild 39: a step, 25 msthe editors: 4.8 msthe rest of the view: 1.4 ms6.2 ms · 56.7 fps16.7 ms10 ms0.1 s1 s0 ms4 ms8 ms12 ms
Builds 8 to 39 of trial/694-view-jit (the table below), each one run of the Firefox check on GitHub's machines. Left: each of the four steps of the neck and arms sliders, from the click to the picture changing; from build 12 the page draws the compiled run's answers first and makes the edit after the paint, and from build 13 the sidebar's outline is built after the paint, not in the view. Build 14's run was on a slower machine (the worker's encode 70 to 82 ms, against 52 on build 13's), so its drag's view (7.5 ms a frame) is to be read against build 13 on a machine like it: 7.7. Build 15's run plotted was on a machine like build 13's, and builds 16 to 20 on ones like build 14's. Right: a 3-second compiled drag of the neck slider, the page's view per frame (dark: the editors; light: the rest), with the drag's frames a second. The frames a second vary from run to run more than the builds differ (builds 9 to 11 changed nothing a drag does and gave 54.3, 47.8 and 56.3); the view's time per frame is steadier.
The Witch slide during a compiled drag of the neck slider on build 12, the frame-rate overlay at top right reading 59 fps
Build 12 (d9d63c13af, run 42658981172): the Witch slide at the end of the check's 3-second compiled drag of the neck slider, in Firefox on GitHub's machines, with the overlay (?hud) at top right: 59 frames in the last second, the longest 33 ms.

^report(50) has builds 1 to 8, each measured the same way:

A slider's step on the Witch, from the step to the picture showing it, build by build (Firefox; a log scale)the picture from the worker's answerthe picture from the slide's run, compiled, in the page1 · the branch as it wasbuild 1: a step at 6402 ms (run 42486001354)build 1: a step at 5613 ms (run 42486001354)build 1: a step at 4169 ms (run 42486001354)build 1: a step at 5208 ms (run 42486001354)build 1: a step at 6520 ms (run 42486001354)build 1: a step at 6313 ms (run 42486001354)build 1: a step at 4925 ms (run 42486001354)build 1: a step at 5535 ms (run 42486001354)4.17 to 6.52 s2 · the answer trimmedbuild 2: a step at 2091 ms (run 42490487136)build 2: a step at 1910 ms (run 42490487136)build 2: a step at 1911 ms (run 42490487136)build 2: a step at 1851 ms (run 42490487136)build 2: a step at 2383 ms (run 42490487136)build 2: a step at 2001 ms (run 42490487136)build 2: a step at 2149 ms (run 42490487136)build 2: a step at 1979 ms (run 42490487136)1.85 to 2.38 s3 · the answer unsharedbuild 3: a step at 1484 ms (run 42492117212)build 3: a step at 1350 ms (run 42492117212)build 3: a step at 1424 ms (run 42492117212)build 3: a step at 1326 ms (run 42492117212)build 3: a step at 1714 ms (run 42492117212)build 3: a step at 1381 ms (run 42492117212)build 3: a step at 1495 ms (run 42492117212)build 3: a step at 1356 ms (run 42492117212)1.33 to 1.71 s4 · the run compiledbuild 4: a step at 469 ms (run 42551267058)build 4: a step at 1659 ms (run 42551267058)build 4: a step at 318 ms (run 42551267058)build 4: a step at 1694 ms (run 42551267058)318 ms to 1.69 s5 · steps back keptbuild 5: a step at 400 ms (run 42556616487)build 5: a step at 236 ms (run 42556616487)build 5: a step at 232 ms (run 42556616487)build 5: a step at 208 ms (run 42556616487)208 to 400 ms6 · change Abuild 6: a step at 416 ms (run 42560502616)build 6: a step at 257 ms (run 42560502616)build 6: a step at 271 ms (run 42560502616)build 6: a step at 223 ms (run 42560502616)223 to 416 ms7 · change Bbuild 7: a step at 434 ms (run 42562102280)build 7: a step at 284 ms (run 42562102280)build 7: a step at 283 ms (run 42562102280)build 7: a step at 245 ms (run 42562102280)245 to 434 ms8 · change Cbuild 8: a step at 290 ms (run 42566328043)build 8: a step at 182 ms (run 42566328043)build 8: a step at 176 ms (run 42566328043)build 8: a step at 222 ms (run 42566328043)176 to 290 ms16.7 ms: one 60 fps frame10 ms0.1 s1 s10 s
A slider's step on the Witch, build by build (^report(50)'s eight builds of trial/694-view-jit, each the one before plus one change; Firefox on GitHub's machines): each dot one step, from the click to the picture changing. Builds 1 to 3 waited for the worker's answer; from build 4 on, the page's compiled run draws the picture first.
A 3-second drag of the Witch's neck slider, frames a second, build by build (Firefox)views and the run compiled: the picture follows the dragnothing compiled: only the slider moves; the picture waits for the release5 · steps back keptbuild 5, compiled: 9.8 fps, median frame 99.6 ms (run 42556616487)9.8 fps, median frame 99.6 msbuild 5, nothing compiled: 6.1 fps, median frame 116.6 ms (run 42556616487)6.1 fps, median frame 116.6 ms6 · change Abuild 6, compiled: 22.5 fps, median frame 49.3 ms (run 42560502616)22.5 fps, median frame 49.3 msbuild 6, nothing compiled: 15.2 fps, median frame 66.4 ms (run 42560502616)15.2 fps, median frame 66.4 ms7 · change Bbuild 7, compiled: 26.4 fps, median frame 33.3 ms (run 42562102280)build 7 again, the same app with the page's view timed part by part: 34.3 fps (run 42563736665, fa2614e1f6)build 7 again, the same app with a first try at change C whose memo missed every frame: 26.2 fps (run 42564711121, bdecaec5d9)26.4 fps, median frame 33.3 msbuild 7, nothing compiled: 21.3 fps, median frame 49.4 ms (run 42562102280)build 7 again, the same app with the page's view timed part by part: 25.5 fps (run 42563736665, fa2614e1f6)build 7 again, the same app with a first try at change C whose memo missed every frame: 26.2 fps (run 42564711121, bdecaec5d9)21.3 fps, median frame 49.4 ms8 · change Cbuild 8, compiled: 48.4 fps, median frame 17.1 ms (run 42566328043)48.4 fps, median frame 17.1 msbuild 8, nothing compiled: 57 fps, median frame 17.1 ms (run 42566328043)57 fps, median frame 17.1 ms60 fps0153045
A 3-second drag of the Witch's neck slider, frames a second, compiled (teal) and with nothing compiled (grey), on builds 5 to 8 of ^report(50). With nothing compiled the picture does not move until the drag ends.

What to expect for your own code:

Expected costs#

Compiling is paid once per definition or program, and is small beside what it saves: about a millisecond, the largest about 20 ms for a livelit's definition, and 87 to 299 ms (median 153) for a slide's whole program, in Firefox. Loading the slides with many livelits is no slower with Compiled views on than off, and on two of them faster; on Polygons, with one livelit, a load took 0.3 s (build 8) and 1.8 s (today) longer, in single runs. On 3e51af567f (run 42654708022) the page compiled 130 livelit definitions on the six polygon slides: most, of about 300 nodes, in a millisecond or less (Firefox's clock reads whole milliseconds here), and the largest, a module of 62,077 nodes, in 14 to 21 ms; all of a slide's definitions together, 19 to 50 ms. A slide's whole run, 24,000 to 112,000 nodes, took 87 to 299 ms (median 153), nearly all of it hazel-jit writing the JS (the browser's new Function took 0 to 14 ms): about 1.3 to 2.8 ms per 1,000 nodes.

Each compilation the page made, its time against the size of the term compiled (both log scales)read 01 ms10 ms100 ms1,000 nodes10,000 nodes100,000 nodesPolygons, a livelit's definition: 8.0 ms to JS + 13.0 ms in the browser; 62,079 nodes, 24,070 characters of JSPolygons, a slide's whole run: 99.0 ms to JS + 0.0 ms in the browser; 62,633 nodes, 27,367 characters of JSPolygons, a slide's whole run: 86.0 ms to JS + 1.0 ms in the browser; 62,651 nodes, 27,562 characters of JSPolygon Viewer, a livelit's definition: 1.0 ms to JS + 18.0 ms in the browser; 24,188 nodes, 6,493 characters of JSPolygon Viewer, a slide's whole run: 125.0 ms to JS + 0.0 ms in the browser; 24,445 nodes, 8,292 characters of JSFull Body, a livelit's definition: 4.0 ms to JS + 10.0 ms in the browser; 62,077 nodes, 24,034 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,565 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,903 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,894 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 305 nodes, 2,905 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 352 nodes, 2,542 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 377 nodes, 2,762 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,901 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,914 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,902 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,899 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 367 nodes, 2,647 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,899 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,902 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,922 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,896 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,903 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 357 nodes, 2,590 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 357 nodes, 2,594 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,905 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,898 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,917 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,905 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,900 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,901 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,903 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 352 nodes, 2,567 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 352 nodes, 2,569 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,905 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 365 nodes, 2,653 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 1.0 ms in the browser; 24,316 nodes, 8,343 characters of JSFull Body, a slide's whole run: 170.0 ms to JS + 14.0 ms in the browser; 111,484 nodes, 226,220 characters of JSFull Body, a livelit's definition: 2.0 ms to JS + 1.0 ms in the browser; 62,077 nodes, 24,034 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 352 nodes, 2,565 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,542 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 377 nodes, 2,762 characters of JSFull Body, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 367 nodes, 2,647 characters of JSFull Body, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 357 nodes, 2,590 characters of JSFull Body, a slide's whole run: 202.0 ms to JS + 9.0 ms in the browser; 111,500 nodes, 226,415 characters of JSWitch, a livelit's definition: 5.0 ms to JS + 15.0 ms in the browser; 62,077 nodes, 24,034 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,903 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,894 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 305 nodes, 2,905 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,542 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,914 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,902 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,899 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 367 nodes, 2,647 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,899 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,902 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,922 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,896 characters of JSWitch, a livelit's definition: 3.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,903 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 357 nodes, 2,590 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 357 nodes, 2,594 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 295 nodes, 1,905 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,898 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,917 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,905 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,900 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 388 nodes, 2,744 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 361 nodes, 2,627 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 361 nodes, 2,625 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 361 nodes, 2,624 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 350 nodes, 2,513 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,909 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 345 nodes, 2,513 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 361 nodes, 2,626 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 361 nodes, 2,621 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 357 nodes, 2,599 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 353 nodes, 2,566 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,901 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 345 nodes, 2,513 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,903 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,903 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,567 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,569 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,905 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 365 nodes, 2,653 characters of JSWitch, a livelit's definition: 1.0 ms to JS + 1.0 ms in the browser; 24,316 nodes, 8,343 characters of JSWitch, a slide's whole run: 286.0 ms to JS + 13.0 ms in the browser; 107,750 nodes, 201,763 characters of JSWitch, a livelit's definition: 3.0 ms to JS + 1.0 ms in the browser; 62,077 nodes, 24,034 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 352 nodes, 2,542 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 367 nodes, 2,647 characters of JSWitch, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 357 nodes, 2,590 characters of JSWitch, a slide's whole run: 209.0 ms to JS + 8.0 ms in the browser; 107,766 nodes, 201,958 characters of JSHands, a livelit's definition: 6.0 ms to JS + 13.0 ms in the browser; 62,077 nodes, 24,034 characters of JSHands, a livelit's definition: 2.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,565 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,903 characters of JSHands, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,904 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 295 nodes, 1,914 characters of JSHands, a livelit's definition: 1.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,902 characters of JSHands, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,899 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 367 nodes, 2,647 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,899 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,904 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,904 characters of JSHands, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,902 characters of JSHands, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,922 characters of JSHands, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,896 characters of JSHands, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,903 characters of JSHands, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,901 characters of JSHands, a livelit's definition: 1.0 ms to JS + 1.0 ms in the browser; 24,316 nodes, 8,343 characters of JSHands, a slide's whole run: 133.0 ms to JS + 5.0 ms in the browser; 94,352 nodes, 94,657 characters of JSHands, a livelit's definition: 4.0 ms to JS + 2.0 ms in the browser; 62,077 nodes, 24,034 characters of JSHands, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 352 nodes, 2,565 characters of JSHands, a slide's whole run: 120.0 ms to JS + 6.0 ms in the browser; 94,368 nodes, 94,852 characters of JSScenes, a livelit's definition: 2.0 ms to JS + 10.0 ms in the browser; 357 nodes, 2,589 characters of JSScenes, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 294 nodes, 1,903 characters of JSScenes, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,904 characters of JSScenes, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 295 nodes, 1,905 characters of JSScenes, a livelit's definition: 0.0 ms to JS + 1.0 ms in the browser; 345 nodes, 2,505 characters of JSScenes, a livelit's definition: 1.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,900 characters of JSScenes, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,901 characters of JSScenes, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,899 characters of JSScenes, a livelit's definition: 0.0 ms to JS + 0.0 ms in the browser; 294 nodes, 1,906 characters of JSScenes, a livelit's definition: 2.0 ms to JS + 1.0 ms in the browser; 24,316 nodes, 8,343 characters of JSScenes, a slide's whole run: 161.0 ms to JS + 7.0 ms in the browser; 101,425 nodes, 142,931 characters of JSa livelit's definitiona slide's whole run
3e51af567f, today's build (3e51af567f, run 42654708022): every compilation the page made while each polygon slide loaded and its livelits were clicked, in Firefox on GitHub's machines (globalThis.hazelJit.compiles). Its time is hazel-jit's part, the term to JS source, and the browser's, new Function and, for a definition, running its module; its size is the elaborated term's nodes (expressions, patterns and types). Firefox's clock reads whole milliseconds here: the dashed row is the compilations that read 0 ms, under one.
What was compiledHow manyMedianRangeMedian parts: to JS + in the browserMedian size, nodesPer 1,000 nodes
a livelit's definition1301.0 ms0.0 to 21.0 ms0.0 + 0.0 ms2940.33 ms
a slide's whole run10153.0 ms87.0 to 299.0 ms147.0 + 6.5 ms97,8961.88 ms

3e51af567f, today's build (3e51af567f, run 42654708022), in Firefox, every compilation the page made on the six polygon slides. ^report(45) measured the Polygons definition at 4.46 ms in Node.

Build 8: each polygon slide loaded fresh, Compiled views on (teal) and off (grey), in secondsPolygons (1 livelit)Polygons, on: 5.8 s5.8 sPolygons, off: 5.5 s5.5 sPolygon Viewer (1 livelit)Polygon Viewer, on: 4.6 s4.6 sPolygon Viewer, off: 4.5 s4.5 sFull Body (43 livelits)Full Body, on: 9.8 s9.8 sFull Body, off: 13.5 s13.5 sWitch (53 livelits)Witch, on: 11.7 s11.7 sWitch, off: 13.1 s13.1 sHands (17 livelits)Hands, on: 7.5 s7.5 sHands, off: 7.2 s7.2 sScenes (10 livelits)Scenes, on: 10.1 s10.1 sScenes, off: 11.8 s11.8 s
Build 8 (61f3f01a15, run 42566328043): one load of each slide each way, in Firefox on GitHub's machines, from the address to every livelit drawn; the time includes compiling each livelit's definition and the slide's run. One run each: the small slides' differences (0.1 to 0.3 s) are within a run's noise.

Other costs, smaller:

How to use it in your own PR#

Base your branch on trial/694-view-jit (hazelgrove/hazel#2817), and every livelit's view and update compiles, with no change to your code. For anything else, call the compiler from OCaml, and check what it does with the command line, the tests and the Firefox check. hazel-jit is not on dev: #2817 is a draft against integration/livelits-modular-editors (hazelgrove/hazel#2635), and hazelgrove/hazel#2819 (livelits-x-jit) hosts the same build for trying. The frame-rate overlay alone is hazelgrove/hazel#2818, for dev.

2026-11-17: #2819 has not followed the prototype since 2026-11-09 (117 commits behind build 49); try build.hazel.org/trial/694-view-jit/ instead. The PRs as they stand now are in ^report(55), The PRs and branches.

In the app#

From OCaml#

CallWhat it does
HazelJit.try_compile(~env, e)An elaborated term to JS source, or the reason it does not compile. compile_full also gives the constructors' types and the functions, for the way back.
HazelJitValue.instantiate(src)Runs the source as new Function("$R", src) with the runtime: the term's value, in JS.
HazelJitValue.to_js(v), of_js(types, ty, js)A Hazel value into JS, and a JS value back into Hazel, read by the type expected where it sits.
HazelJitValue.view_of_def(~env, def)A livelit definition compiled once (cached by term), its view kept; then call_view(v, model) (the answer in JS), run_view (back in Hazel) and call_update(v, model, action).
HazelJitDOM.go(mvu, types, answer)A view's answer drawn straight from its JS, every form HazelDOM draws.
HazelJitValue.enabledThe setting, a ref(bool).

To check it#

What has been added since the first version#

The first version (8c5cd80a29, 2026-11-06 11:48) compiled an elaborated term to a JS function in a test, and checked it against the interpreter. Since then, 133 commits: livelits' views and updates compiled in the app and drawn straight from JS, a slide's whole run compiled with its livelits' models as parameters, a drag's fast path in three changes, and the tools to measure each of them in Firefox.

The branch's 134 commits since hazel-jit's first, by when and by what they didthe compiler8c5cd80a29: hazel-jit: an elaborated term compiled to a JS function, and tests that it agrees with the interpreter79fe5bbebf: hazel-jit: modules, to_fixed, and the Polygons slide's view compiled whole, agreeing with the interpreter567c8d9620: hazel-jit: a negative number written with a minus goes into JS; the browser check settles between clicks (^ticket(716))livelits in the app7a7151443c: hazel-jit: livelits' views run as compiled JS, through a boundary that carries values both ways97ba46706b: hazel-jit: cheaper ids, a view drawn straight from its JS, and the way back as a diff889271cfbb: hazel-jit: a livelit's view drawn straight from its compiled JS in the app, every form HazelDOM draws (^ticket(714))4c0ed173f1: hazel-jit: a livelit's update runs compiled, its new model carried back as a diff (^ticket(715))bcec455abc: hazel-jit: a view's splice commands answered in JS; the Witch slide's ^picture timed (^ticket(694), ^report(46))cb560ebb86: hazel-jit: a model that cannot go into JS no longer gives up on its definition; the Witch's picture compiles after the runa slide's run compiled0926a80c74: hazel-jit compiles the Witch slide's whole run, 76-127 times faster (^ticket(722))ab4a41e587: hazel-jit: a slide's run with its livelits' models as parameters (^ticket(722))1d445a24cc: At a livelit's event, the slide's compiled run draws every livelit (^ticket(722))932fbdcc63: Fold each livelit's view into the slide's compiled run, as Statics does for a probed use (^ticket(722))6d71c427bf: Fold a macro livelit's view into the slide's compiled run too (^ticket(722))a51dc778dd: A step back to a slider's starting value keeps the compiled run's answers (^ticket(722))7f5add1519: Compile a slide's run once, and keep its answers when the worker catches up (^report(50) next steps 3 and 4)a drag's fast path9fca635226: A livelit's drag redraws the page with no editor action (^ticket(722), the drag fast path, cut A)38d4e4d0f8: A drag redraws only the livelits whose answers changed (^ticket(722), the drag fast path, cut B)bdecaec5d9: A drag's frames reuse the projectors' data and finished views (^ticket(722), the drag fast path, cut C)61f3f01a15: Cut C's memo keys on the elaboration itself, and the samples' union is kept (^ticket(722))the worker's answer20a3067c18: Two cuts to the worker's answer: no function-holding values in samples' environments, and no trace4747a4120d: The worker's answers are not shared any moremeasuring it14b006d008: hazel-jit: a timing probe (slow tests): the Petri net rule and a recursive sum, interpreter against compiled JS; formatted58ac2c4206: hazel-jit: the timing tests print each run's reading as a line of JSON810df240ea: hazel-jit: time the boundary's two trips apart, and warm up before timing433a216bd7: hazel-jit in the app, in a real Firefox: the polygon slides compiled and not (^ticket(716), ^ticket(717))28fc073ed5: hazel-jit beside hand-written JS on report 043's Petri net rule (^ticket(699))1362ff34d5: hazel-jit: each drawn livelit view can be timed again in the page, both ways; the Firefox check times the Witch slide's25226a8f79: hazel-jit bench in the page: one entry per use, each run says how it ran, samples long enough for Firefox's clock2a5b2ffefa: hazel-jit check: time a small edit on the Witch slide, both waysf88bf0ae8b: A timeline for an edit's time in the page, read by the Firefox checkde045afb22: BenchMarks.time: no annotation on the optional extra (refmt dropped its parentheses, and the type read as the option's)3ed2f31844: Util exports BenchMarks (the library lists its modules by hand)a1b9cdfde4: What the worker's answer holds, and the worker's own timelinedfa3fcdffe: The answer's breakdown estimates sizes by a walk, not Marshal405bc81bfc: The answer's breakdown names what its largest probes' samples hold6de7255c40: Tests that decode a request name the new Record messagea64335dc37: Experiment 1 for ^ticket(718): the Witch's picture sent each way2997daa6c6: Experiment 1: each part of the picture's bytes split four ways, for treemaps6ae614198f: Experiment 1: the conversion to data is one linear walk2432f0d166: Experiment 1: the picture's parts found under the livelit's model480a30a8dd: Experiment 1: each shape's bytes as it adds them, so the treemap adds upe69234eb95: Experiments 3, 4 and 5 for ^report(47): ids minted, printing, into JS238144b4b8: Experiment 2, a first slice, for ^report(47): building the picturee1967c3a40: Time ^report(47)'s experiments 2 to 5 in batches of 300 ms, not 254299efd6d3: hazel jit --check: compare every name a program's top-level lets bind06a3880c01: Count why a slide's compiled run is not used, for the Firefox check (^ticket(722))e1c5316cf9: A frame-rate HUD, on with ?hud in the address (^ticket(722))bf6b2d6090: The Firefox check drags a slider, every frame timed, with HUD screenshots (^ticket(722))bb88edfd12: The drag's screenshot shows the picture, the slider driven out of view (^ticket(722))fa2614e1f6: The page's view timed part by part, for the drag's timeline (^ticket(722))3e51af567f: The run's comparison after the paint, and every compilation timed (^report(50) step 3, ^report(51))1524e96da3: Probe samples' first-order values cross from the worker as data (^ticket(718), ^report(50) step 7)b37d2e6df1: A step's edit is made after the paint, once the compiled run has drawn it (^report(50) step 2, ^ticket(721))d9d63c13af: A drag's frames reuse each editor's decorations and probes' views (^report(50) step 1)22cd278106: Samples as data off: the answer grew; surveyed instead (^ticket(718), ^report(50) step 7)c419e01559: Formatted (refmt): LivelitProj's after_paintd59410bade: The outline is drawn again only when what it shows changed (^report(51))dc3f807864: Revert "The outline is drawn again only when what it shows changed"bfbd88a1ae: The outline is built on its own, after the paint, not in the page's view (^report(51))8bf44f23cf: OutlineAsync: option's None, not Node's (the build of bfbd88a1ae failed)d1ef274c10: Each projector drawn says its kind, its id and why its cache missed (^report(51))af099c780d: A probe's view, timed by its parts (^report(51))e1bb06d115: A probe's row abbreviates its value without rewriting all of it first (^report(51))99542e86e3: Abbreviate.rei: abbreviate_exp's ~see_through (the build of e1bb06d115 failed)a65a9e5f52: After a compiled answer, the worker's plan and streams wait for its result (^report(51))b310a58b67: Each update names its action by its tags; a probe's value check and rich view timed (^report(51))515813903a: A probe's value check remembered per value; each projector drawn says which own parts it kept (^report(51))d35f2f2619: A livelit's cached view keys on its own statics and elaborated subterm, not the whole maps (^report(51))a1b43cba46: A livelit's key: its own statics record, with no elaborated subterm needed (^report(51))1da80a8022: The autosave's parts, timed for the check (^report(51))f4bcd64cf7: The autosave writes the model without an update: the page draws nothing again (^report(51))b34491d761: The check notes how much of a new program is the old one's very subterms (^report(51))c016370918: The comparison after a step erases only what changed: erase remembered per node (^report(51))b195b09088: erase's erased node annotated Exp.t (the build of c016370918 failed)f125a69a7b: After a compilation, a run for the printed answers: the first step draws only what it changed (^report(51))1dc99165ba: The outline keys a run's test results by each test's status, not the record's identity (^report(51))854b40ee7d: Slot.get's on_miss without an annotation; the outline redraws the page only when it changed (^report(51))bd24b35aaa: A livelit's cached view is kept across a run's new answer while what it read of the run is the same (^report(51))69459eafac: The outline's miss diagnostic compares entries' own fields, only when the outlines differ (^report(51))f813da534d: The outline diagnostic's entry shape is a flat list (^report(51))7ca0646d5c: The worker marks a result's bytes by part, for the check (^ticket(718))19d7af266a: The answer's parts name the eight probes with the most samples (^ticket(718))d3f046a9b2: The answer's parts weigh two cuts: no final streams, and no cache in the states (^ticket(718))9ae7706f93: The answer's parts: the largest probes by bytes, and the result's probes' values and environments apart (^ticket(718))01a5e8ecb0: A result goes without the last item's final stream: the page dropped it on arrival (^ticket(718))66b999aae3: A result's first-order sample values go as data again, results only (^ticket(718))f432751f99: FirstOrder.of_term takes a label and a constructor head as why_not does (^ticket(718))7c2d886de7: Time FirstOrder.of_term, to_term and the check apart from rebuilding the states (^ticket(718))df047ef786: Time the outline draw's parts: error rows, refusals, livelit rows, blank bodies, rows (^report(51), step 1)9f75f59261: Time the autosave text's parts: printed, result persisted, written (^report(51), step 8)2b88bf18bf: The outline's refusals find a projector's path only when a row is inside it (^report(51), step 1)263ecc3e84: The autosave prints again only the top-level pieces a step changed (^report(51), step 8)d68bd6400b: Test: the autosave's text, unchanged pieces kept, is the whole print (^report(51), step 8)a1ab2e52d4: The outline's refusals ask for a row only of an unfinished tile or a use (^report(51), step 1)585feb6b51: Time the parts of the editor's calculate: the syntax cache, probe effects, autoprobe, tail and proofs (^report(51))3615e5ebb6: A probe's value check looks at plain data's shape before running the step rules (^report(51))0ddf3b9efe: Time the projectors' views at a redraw, and count those made again (^report(51))20bf41c334: Name the syntax cache's path at each calculate, and time a shape refresh's parts (^report(51))0363043a53: Count where the projectors' kept views spend a redraw: lookups, splice walks, values compared (^report(51))5fdb0d3004: Removing no probe keeps the probes' list, so the syntax cache is not refreshed for nothing (^report(51))a3ba9f6474: A kept livelit keeps its finished views across a worker's answer, when its view comes back the same (^report(51))1d485cc0ad: The same shapes keep the splice map, as they keep the measured layout (^report(51))96a5031217: Fix builds 26 and 30: the test's terms from FreshGrammar, and None qualified where Node's shadows it3f8ccae8b6: A livelit's shape kept by its definition and model value; an equal projector list stands for the last (^report(51))285968fd06: Time the shape cache's compares, keep a use's applied livelit, and sum marks' counters over drags (^report(51))1d53e66e27: The applied-livelit memo missed 40 of 53 at each pass, and the sidebar remade its problemsc1476f1244: A livelit's shape that does not read its model is kept by its definition alone0ba9f99b37: Time the projectors' shapes per call, and keep a use's newest argumentsd8c2bbb671: Declare the splice-size timer before shape_of, which reads it62a517d8b4: The outline's refusals keep each top-level tile's part while the rows are the same3e3118f380: A probe's view is kept by its own statics record, as a livelit's is19ecb75694: A view cache hit on equal reads takes the new map, so the next look is a pointer9a5a3e7a64: A projector's hidden-syntax error check is kept by its syntax and statics mapf5b7a65cf2: Time the outline mark and the outline's fetch in the page's viewa02025f5dc: The outline's mark stands while the edited program's outline is not builtcfcd82582f: Time the statics' parts and the zipper's action, for a slider's step (^ticket(721))503751b4e1: A projector's update steps only into the pieces that hold it (^ticket(721))b031426c2f: ProjectorPerform.go's layout a labelled option, not an optional argument (the build of 503751b4e1 failed: warning 16)421e30a04b: Perform passes the layout as Some, as ProjectorPerform.go now takes it (b031426c2f changed only the callee)e26704028e: A slider's commit that changes only its model's literals patches the statics in (^ticket(721))ea4a2ee75a: ModelPatch: the projector node's term annotated (the build of e26704028e failed: Projector unbound in a record update)1ea585bea8: ModelPatch: InfoExp qualified where the map's type is not yet known (the build of ea4a2ee75a failed)3e69593077: The statics patch runs for a projector commit's Force, when nothing was pending (^ticket(721))d90a8cf135: ModelPatch.along follows the program's spine down to an item (^ticket(721))9ae518ffe7: The model-only patch moves inside DefStatics: the edited item patched, not analyzed (^ticket(721))fc1103900d: The item-patch test spells its literal by its form, as a tile has no label field2a1a63f878: hazel-jit's runtime has the string builtins the sweep found missing: match, replace, search, join, escaped, capitalize877836cfd4: The compare builtins in hazel-jit's runtime: int, sint, nat, float and string_compare, and invert_ord0e9e555b8e: string_escaped's test in Hazel's own string form: a backslash is a character there, and \" ends the string8c70a9b1b8: hazel-jit compiles partial application, f(a, _, c)ea1cad31c5: A _ outside a partial application keeps its own arm: it shared DeferredAp's or-pattern, which now binds names7b4c141446: The partial-application-to-a-map test with its own map: List is no module in the tests' environment2342ee7aa1: Compile recursion over more than one name, a tuple of functionsnoonNov 7noonNov 8noonNov 9noonNov 10noonNov 11noonNov 12noonNov 13noonNov 14noonNov 15noon
Not a build: the commits of trial/694-view-jit from hazel-jit's first (8c5cd80a29, 2026-11-06 11:48 MST) to today's, each a dot (hover for its message), in a row by what it does (read from its message by hand). Measuring it includes the tests, the Firefox check, the timelines and ^report(47)'s experiments on values as data. Mountain time.
WhatCommit, dayReport
The compiler
Modules, to_fixed, and the Polygons slide's view compiled whole79fe5bbebf, 11-06045
Cheaper ids; a number written with a minus97ba46706b, 567c8d9620, 11-07045
A livelit's use and a splice compiled as what they hold, %splice_value in JS, and a survey mode: a form it does not compile becomes a stub that throws only if reached0926a80c74, 11-08045
Livelits in the app
Livelits' views run compiled, through a boundary that carries values both ways7a7151443c, 11-06045
A view drawn straight from its JS (HazelJitDOM), every form HazelDOM draws889271cfbb, 11-07045
An update compiled, its new model carried back as a diff4c0ed173f1, 11-07045
A view's splice commands answered in JS; a model that cannot go into JS no longer gives up on its definitionbcec455abc, cb560ebb86, 11-07046
A slide's whole run, compiled
The Witch's whole run compiled (command line), 76 to 127 times faster0926a80c74, 11-08045
Each livelit's model a parameter, so a step is a call with a new argument, not new codeab4a41e587, 11-08045
At a livelit's event, the run draws every livelit; each livelit's view folded into the run, a macro livelit's too1d445a24cc, 932fbdcc63, 6d71c427bf, 11-08049
A step back to a slider's starting value keeps the run's answersa51dc778dd, 11-08049
Compiled once, not again after a step; its answers kept when the worker catches up; the worker's request held7f5add1519, 11-09this one
A drag's fast path (not the compiler, but what a compiled run made worth doing)
Change A: a drag's events redraw the page, with no edit of the program9fca635226, 11-08050
Change B: only the livelits whose answers changed are drawn again38d4e4d0f8, 11-08050
Change C: the projectors' data and finished views reused from frame to framebdecaec5d9, 61f3f01a15, 11-08050
Measuring it
Timing tests against the interpreter, and beside hand-written JS on the Petri rule14b006d008, 28fc073ed5045
The Firefox check: drawings compared, events and steps timed, each view timed both ways in the page433a216bd7, 1362ff34d5, 2a5b2ffefa045, 046
The page's timeline, and the worker's ownf88bf0ae8b, a1b9cdfde4046
The frame-rate overlay (?hud), and a timed drag with screenshotse1c5316cf9, bf6b2d6090050
Compile times in the page, each in two parts3e51af567f, 11-09this one

Also on the branch, outside hazel-jit: two changes to the worker's answer (20a3067c18, 4747a4120d, ^report(46)) and the experiments on values as data (^report(47)).

Limitations#

Compiled code is not yet Hazel's semantics in every corner, and not everything compiles. Each limit below falls back to the interpreter or is a known difference; none of them has given a different drawing on the six polygon slides.

Next steps, ongoing now#

Five changes are under way today, in the order Matthew set (2026-11-09: "items 3 and 4 and 7. Then after that, items 1 and 2"), numbered as in ^report(50)'s What next. Steps 3, 4, 2 and the first part of 1 are in, as builds 9 to 12 (the table), each measured in Firefox on the Witch. Step 2 brought a step from 176 to 290 ms down to 19 to 24; step 1's first part took 2 to 4 ms off each frame of a drag; step 3 did what it set out to; step 4 kept the answers but not the page's redraws; step 7's first slice made the answer larger and is off. Build 13 then took the sidebar's outline out of the page's view (Matthew, 2026-11-09: "no memoization, but isolation, instead"): the views after each worker message went from 88 to 130 ms to 45 to 63. Build 14 then took on the rest of the page's work after a step: 0.56 to 0.92 s on build 13 to 0.37 to 0.52 s, on machines of the same speed. Build 15 keeps the livelits an edit does not touch; on a machine like build 13's, the page's work after a step is 0.24 to 0.30 s, against 0.43 to 0.60. Builds 16 to 19 took on the rest: the autosave out of the update (16), the comparison after the paint 1 ms (17), the first step like the others (18), and the work the worker's answer caused for nothing (19): after a step, 0.31 to 0.40 s against 0.34 to 0.55 on build 18. Build 20 made the worker's answer 198 KB, from 590: no final stream the page dropped, and the result's values as data. Builds 21 to 24 then time the parts of three costs and take on two: the outline after an edit, 29 to 32 ms from 42 to 53 (finding which rows open no cell, 11 to 14 ms from 32 to 40), and the autosave, 21 to 31 ms from 38 to 67 (printing the program 3 to 6 ms from 25 to 48). Builds 25 and 26 take on the page's work at the worker's answer: the picture's probe row 3 to 6 ms from 15 to 35, the view there 31 to 64 ms from 50 to 75. Builds 27 to 38 go on at the worker's answer and after the edit: the whole view at the answer about 30 to 35 ms, the page's work after the picture 167 to 183 ms a step (236 to 300 on builds 25 to 34), and a drag's view 6.3 ms a frame (8.2 on build 30).

BuildWhat it adds to the one aboveA step, to the pictureA compiled drag
8 · change C (^report(50)'s last)
61f3f01a15, run 42566328043
^report(50)'s build 8, for comparison.176 to 290 ms48.4 fps
view 10.1 ms a frame
9 · steps 3 and 4
7f5add1519, run 42651798712
The slide's run compiled once and kept when only models change; its answers kept when the worker catches up; the worker's request held after a compiled step.204 to 374 ms54.3 fps
view 8.6 ms a frame
10 · the comparison after the paint
3e51af567f, run 42654708022
The program compared after the paint, not in the view; every compilation timed.183 to 398 ms47.8 fps
view 9.8 ms a frame
11 · samples as data
1524e96da3, run 42657604986
Probe samples' first-order values sent from the worker as data (step 7's first slice; it made the answer larger, and is off since 22cd278106).152 to 284 ms56.3 fps
view 8.2 ms a frame
12 · steps 2 and 1
d9d63c13af, run 42658981172
A step's edit made after the paint, once the compiled run has drawn it (b37d2e6df1); each editor's decorations and probes' views reused across a drag's frames.19 to 124 ms57.6 fps
view 6.1 ms a frame
13 · the outline on its own
8bf44f23cf, run 42670654733
The sidebar's outline built on its own after the paint, not in the page's view (bfbd88a1ae, 8bf44f23cf; Matthew: "no memoization, but isolation, instead"). Also samples as data off again (22cd278106), as on the team's hosted build. Its other run (42668742255) landed on a machine 20 to 40% slower on work this change does not touch, and read slower throughout.24 to 72 ms57.6 fps
view 4.9 ms a frame
14 · the page after a step
b310a58b67, run 42690151014
A probe's row abbreviates its value without rewriting all of it first (e1bb06d115, 99542e86e3); after a compiled answer, the worker's reuse plan and streams wait for its result and come with it as one action (a65a9e5f52); each projector drawn and each update named on the check's timeline (d1ef274c10, af099c780d, b310a58b67). Its machine was slower than build 13's (the worker's encode 70 to 82 ms, against 52): the fair comparison is build 13 with the same timing marks on a machine like it (af099c780d, run 42685958876, encode 68 to 86), see the text.25 to 131 ms52.0 fps
view 7.5 ms a frame
15 · livelits kept across an edit
1da80a8022, run 42697957029
A livelit's cached view keyed on its own statics record, not the whole statics map and elaborated term (d35f2f2619, a1b43cba46): after an edit only the edited livelit is drawn again, not all 53; a probe's value check remembered per value (515813903a). Plotted: a run of a1b43cba46 with the autosave's parts timed (1da80a8022, nothing else changed), on a machine like build 13's (the worker's encode 56 to 72 ms, against 52). Its other run (a1b43cba46, run 42696123420) was on a machine like build 14's.16 to 126 ms58.6 fps
view 4.4 ms a frame
16 · the autosave on its own
f4bcd64cf7, run 42699757678
The autosave writes the page's model without going through the update (Main.apply), so the very same model comes back and nothing is drawn again: after each autosave, no calculate, whole view or outline (about 60 ms on build 15's run). On a machine like build 14's (the worker's encode 73 to 109 ms), so its steps and drag read slower than build 15's run.21 to 124 ms51.7 fps
view 7.4 ms a frame
17 · the comparison, only what changed
b195b09088, run 42703776919
The comparison after a step erases only what the step changed: erase remembered per node (c016370918, b195b09088), since the new program is the old one's very objects but for 36 to 49 nodes (b34491d761). The comparison 33 to 43 ms before (run 42701761078), 1 ms now; the run kept at every step as before (5 of 5). On a machine like build 14's (the worker's encode 82 to 102 ms).28 to 132 ms45.7 fps
view 8.6 ms a frame
18 · the first step like the others
f125a69a7b, run 42713728065
A run of the slide's program right after each compilation, kept only as the printed answers (HazelJitRun.prime), the baseline the first step compares with: before it, every livelit counted as changed on the first step and all 53 were drawn again. The first step's first view 26 ms, from 65; its picture 92 ms, from 132 (build 17); 3 projectors drawn, not 54. A machine like build 14's (the worker's encode 71 to 88 ms).20 to 92 ms55.7 fps
view 6.6 ms a frame
19 · the page after an answer
f813da534d, run 42739071781
What the worker's answer costs the page, trimmed where it redid work for nothing: the outline keys the run's test results by each test's status, not the results record, new at every answer (1dc99165ba), and redraws the page only when it drew a new outline (854b40ee7d); and a livelit is kept across an answer while what its drawing read of the run, its own samples and those it looked up, is the same by value (bd24b35aaa). After each answer 4 projectors are drawn, not 56; the outline's 59 to 82 ms are gone there, and its redraw of the page. The page's work after a step 0.31 to 0.40 s, against 0.34 to 0.55 s on build 18 (a machine a little slower than build 18's: the worker's encode 85 to 107 ms).26 to 98 ms51.0 fps
view 7.6 ms a frame
20 · the answer as data
f432751f99, run 42747955240
The worker's answer, weighed by part (7ca0646d5c to 9ae7706f93), was 590 KB: 112 KB of it the last item's final stream, the cache entries finished since the last stream (216 states, each with every probe so far), which the page decoded and merged only to drop, since a result sets the streamed outbox aside; the rest the result's own probes, 108 samples, the picture (about 140 KB as a term) reached from several. A result goes without that stream now (01a5e8ecb0: 475 KB), and its first-order sample values go as data (66b999aae3, with FirstOrder.of_term taking a record's labels as the survey does, f432751f99): 17 values a result, none different back. The answer 198 KB; the worker's encode 21 to 29 ms (72 to 107 on build 19), with 29 to 41 ms making the data; the page's decode 7 to 8 ms (24 to 31), with 6 to 17 ms making the values terms again (70 once). The page's work after a step 0.21 to 0.32 s.20 to 40 ms55.6 fps
view 5.9 ms a frame
21 · the parts timed
9f75f59261, run 42758371511
Timers only (7c2d886de7, df047ef786, 9f75f59261). The worker's making data is FirstOrder.of_term, 16 to 50 ms, and a check of each value's way back, 13 to 64 ms, which runs only while the check records; build 20's 29 to 41 ms counted both. The page's making terms is to_term, 5 to 10 ms. The outline drawn after an edit, 42 to 53 ms, is 32 to 40 ms of finding which rows open no cell (ScratchFocus.refusals), the rows themselves about 8, the error rows 2 to 4. The autosave, 38 to 67 ms, is 25 to 48 ms of printing the program for the slide's text, 4 to 7 writing it, 5 to 14 the items.17 to 77 ms56.3 fps
view 6.4 ms a frame
22 · refusals, paths when asked
2b88bf18bf, run 42759149693
Finding which rows open no cell searched from the program's root for the path to each of the Witch's 53 livelits, though a path is read only for a row inside one (none here). Made lazy, forced just where it was read: the same refusals, 25 to 29 ms (32 to 40).25 to 106 ms55.4 fps
view 6.4 ms a frame
23 · the autosave, only what changed
d68bd6400b, run 42760087460
The autosave prints again only the top-level pieces a step changed, each piece's text kept by its identity (263ecc3e84); the whole program when a probe wraps a top-level piece or the probes changed. A test checks the text is the whole print's (d68bd6400b). Printing 3 to 6 ms (25 to 48 on build 21), the autosave 21 to 31 ms (38 to 67).23 to 90 ms46.8 fps
view 8.0 ms a frame
24 · refusals, asked last
a1ab2e52d4, run 42761046647
Finding which rows open no cell asked whether each tile was a row, twice, a lookup in a map of ids, before its cheap tests; now only of a tile that is unfinished or a use (and of the pieces inside a livelit), the same answers: 6,753 asks of 43,171 pieces walked, 11 to 14 ms (25 to 29 on build 22); the outline drawn after an edit 29 to 32 ms (42 to 53 on build 21).25 to 88 ms54.3 fps
view 6.9 ms a frame
25 · the answer's syntax timed
585feb6b51, run 42770858700
Timers only. When the worker's answer arrives, the cell's editor works out its syntax twice, before and after it takes the answer's samples: the syntax cache 9 to 26 ms the first time and 9 to 16 the second, the probe effects, autoprobe, tail and proofs 0 to 1 ms.22 to 120 ms56.0 fps
view 7.1 ms a frame
26 · plain data is a value
0ddf3b9efe, run 42771757499
A probe's row asks whether each sample is a value, to grey out one that is not; it ran the evaluator's step rules over the whole value, and the picture's took 9 to 31 ms at each answer on build 24. Plain data (literals, labels, constructors, and lists, tuples and constructor applications of plain data) is a value exactly when its parts are, so it is now answered by its shape, with the step rules for anything else (3615e5ebb6; its test, which did not compile until build 30, passes there). The check 0 to 1 ms; the picture's probe row 3 to 6 ms (15 to 35); the page's view at the answer 31 to 64 ms (50 to 75). A new mark (0ddf3b9efe) shows the projectors' views made again for all 53 livelits at each answer, 16 to 41 ms, though 2 are drawn.23 to 85 ms51.0 fps
view 8.8 ms a frame
27 · the syntax cache's path named
20bf41c334, run 42772671441
Marks only: each calculate's syntax cache names why it refreshed the shapes. At the answer the first pass refreshed because the probes' list was a new object ("manuals"), though no probe had changed; the second for the answer's dynamics and the same. The refresh is the projectors' shapes, 5 to 14 ms (52 once), and the splice map, 2 to 4.25 to 59 ms56.7 fps
view 6.0 ms a frame
28 · the kept livelits counted
0363043a53, run 42773608842
Counters only. At each answer the 53 livelits' views made again took 16 to 22 ms: the view cache 4 to 12 of it, mostly comparing 104 sample values by value (2 to 8 ms), and 10 to 12 wrapping the views the cache gave back. The same happens once more after a step, before the answer (16 to 28 ms).21 to 92 ms56.4 fps
view 6.5 ms a frame
29 · the probes' list kept
5fdb0d3004, run 42774510803
Each calculate asks to remove the probes that collide on a row, mostly none, and the removal made a new list each time, so the next calculate's syntax cache refreshed the shapes as if the probes had changed. Removing none now keeps the very list (its test first ran on build 30, and passes). At the answer the first pass takes 0 ms (8 to 19 on build 27), the second, for the answer's dynamics, 8 to 13; the cell's calculate there 10 to 15 ms (15 to 43 on build 26).22 to 58 ms58.0 fps
view 5.7 ms a frame
30 · kept livelits keep their wrappers
96a5031217, run 42775688527
A projector's finished views were reused only while its data was the very same object, and a worker's answer makes new data for every projector. Now one whose view comes back from the cache the very same, for the same projector, place, status and shape, keeps them (a3ba9f6474); and the same shapes keep the splice map, as they keep the layout (1d485cc0ad). The first try at this did not compile, and builds 26 to 29's tests did not either (96a5031217 fixes both; CI passes). At each answer 51 of the 53 livelits keep their finished views, and the splice map is not made again; but the views still take 13 to 37 ms, as working out the livelits' shapes takes 3 to 29 of them. After an edit no livelit kept its views: the projector list was new, though its ids were the same.21 to 93 ms51.7 fps
view 8.2 ms a frame
31 · shapes by value, an equal projector list
3f8ccae8b6, run 42783064879
A livelit's shape was kept by its sample's number, which each run of the worker counts afresh; now by its definition and its model's value. And a projector list equal to the one an editor last drew with stands for it. At the answer, and in the redraw after the edit, 51 of the 53 livelits keep their finished views; no shape function is evaluated at all (a new mark counts them); the projectors' views at the answer take 11 to 16 ms (13 to 37 on build 30). But a drag got slower: its projectors' views take 12.0 ms a frame, against 3.9 on build 30, and after an edit one projector's shape took 12 ms. The new check compares something node by node; build 32 times its parts.21 to 123 ms39.2 fps
view 15.1 ms a frame
32 · a use's applied livelit kept
285968fd06, run 42793713877
A use with arguments, like ^slider(..), had its livelit applied to them anew at each lookup, a new copy of the definition each time, so build 31's shape check, keyed on the definition, compared two equal copies node by node. Now a use's applied livelit is kept while its livelit, type and arguments are the same, and the check's parts are timed. A drag's view is 5.4 ms a frame (15.1 on build 31, 8.2 on build 30), its projectors' views 2.6 (12.0); over the whole drag the definition compares take 1 ms. But that drag did less than the others: with the compiled run off it was as fast, 5.5 ms a frame, where builds 30 and 34 take 15.3 and 15.0 (the interpreter drawing each livelit, 4.6 ms), and it compared no model value at all, so its 5.4 is not a mark to hold other builds to. At the answer the projectors' views take 8 to 20 ms (11 to 16); the whole view 25 to 98, as one probe's drawer took 40 ms once, at the first step (1 to 2 on builds 30 and 31). The memo held 16 uses of a livelit and emptied itself when full; the Witch uses ^slider 29 times and ^choice 18, so each pass over all 53 still applied 38 to 43 anew. CI's full tests ran out their 100 minutes (57 to 90 on builds 30 and 31); build 34's, with this code and more, passed in 57, so it was a slow run, not a hang.22 to 41 ms58.3 fps
view 5.4 ms a frame
33 · the memo holds 64, the sidebar's problems kept
1d53e66e27, run 42808401120
The applied livelits' memo holds 64 uses of a livelit and drops only its oldest: none is applied anew, at the answer or in a drag (38 to 43 of 53 at each pass on build 32). The sidebar's problem list is kept at an answer, by the five parts of the syntax it reads: 2 to 3 ms (3 to 29 on build 31). The decorations (1 ms) and the probes' views (6 to 7) are timed apart, at the first step 41 and 26. The whole view at the answer is 28 to 31 ms at steps 2 to 4 (36 to 60 on build 31), 100 at the first. But a drag got slower again, its view 16.1 ms a frame (5.4 on build 32), 38 fps: the shape cache now compared a livelit's model value at each frame, one of them 8 to 13 ms a walk, and the syntax pass's shapes at the answer took 17 to 50 ms (8 to 20). Build 32's drag walked no value; why is not yet known. Its CI's tests were cancelled by build 34's push; its static checks pass.21 to 70 ms38.1 fps
view 16.1 ms a frame
34 · a shape kept by its definition when it does not read the model
c1476f1244, run 42809664205
Only a shape that is a function of the model reads it, and none of the Witch's livelits has one, so the shape cache now notes whether a shape read the model and keeps one that did not by its definition alone; a value walked and found equal stands for the old. A drag's view is 7.0 ms a frame (8.2 on build 30, 16.1 on build 33), 55 fps, with no value walked. At the answer the cell's calculate takes 7 to 8 ms and its shapes 5 to 6 (17 to 50 on build 33), once 35 and 31; the whole view 30 to 65 ms. The projectors' shapes there take 3 to 5 ms at two answers and 31 to 32 at the other two, with nothing evaluated or walked: one 31 ms cost a step, in the syntax pass or the view, which build 35 times per call. CI passes, its full tests in 57 minutes.21 to 96 ms55.0 fps
view 7.0 ms a frame
35 · the shapes timed per call
d8c2bbb671, run 42811452787
Marks, and a use's newest arguments kept in the memo (0ba9f99b37; d8c2bbb671 declares a timer the first try read before it was made, which did not compile). At the four answers the projectors' shapes take 3 to 9 ms, the longest single call 1 to 6, on a different livelit each time: build 34's 31 ms was not a shape. A cost of 20 to 35 ms still comes once a step after the answer, each time somewhere else: in the syntax pass's shapes (24 ms, step 1), in one livelit drawn (33 ms, where it takes 2), in the decorations (28, where they take 1 to 2); in the drags, one shape call of 50 ms and one of 141. It looks like the browser's collection of the answer's garbage, which the page cannot time. Without it the view at the answer is about 35 ms: the projectors' views 8 to 15 (the view cache comparing 104 values by value, 1 to 6), the probes' views 7 to 9, the projector data 4 to 5, the sidebar 3 to 4. The page's work after the picture is 206 to 215 ms at steps 2 to 4 (236 to 300 on builds 25 to 34).18 to 77 ms52.7 fps
view 8.1 ms a frame
36 · the outline's refusals kept per top-level tile
62a517d8b4, run 42813221124
After each edit the outline is drawn again, its entries the same but the statics new, and finding which rows open no cell walked all 43,171 of the Witch's pieces, 10 to 11 ms. An edit leaves nearly every top-level tile the very same object, so each one's part of that walk is now kept by the tile while the rows wanted are the same: 226 tiles kept, 887 pieces walked, 0 to 2 ms. The outline after an edit takes 18 ms at steps 2 to 4 (25 to 27 on build 35), its rows drawn 10 to 14. A drag's view is 6.6 ms a frame.21 to 99 ms55.0 fps
view 6.6 ms a frame
37 · a probe kept by its own statics
3e3118f380, run 42814828261
After an edit of a livelit's model both probes were drawn again, 4 to 13 ms a view, though their own statics records were the very same objects: their views were keyed on the whole statics map and the elaboration. ProbeProj reads neither its elaborated subterm nor another id's statics, so a probe is now keyed on its own record, as a livelit is; its run is still keyed on the whole map, as a probe's samples carry call stacks and steps. After an edit no probe is drawn, the probes' views 1 to 3 ms, and the whole view 31 to 43 ms at steps 2 to 4 (37 to 62 on build 35). The page's work after the picture is 175 to 182 ms at steps 2 to 4 (206 to 215 on build 35). A drag's view is 5.2 ms a frame, 168 of 173 frames within 60 fps.19 to 75 ms57.6 fps
view 5.2 ms a frame
38 · a cache hit on equal reads takes the new map
19ecb75694, run 42817304210
A view cache hit whose reads are equal by value now takes the new map and its samples, so the next look at the same map is a pointer: after each edit the livelits' 100 to 102 sample values, read against the map each was drawn with, are not compared again (2 to 5 ms). The page's work after the picture is 167 to 183 ms at steps 2 to 4; a drag's view 6.3 ms a frame, 160 of 167 frames within 60 fps. Its first run (42816040542) landed on a slower machine (the worker's encode 32 to 36 ms against 25 to 31, the slide's run 260 ms against 176, the compiled run in a drag 2.8 ms a frame against 1.1 to 1.5) and read slower throughout: 213 to 230 ms, and a drag 10.8 ms a frame.20 to 78 ms55.7 fps
view 6.3 ms a frame
39 · a projector's hidden-syntax error check kept
9a5a3e7a64, run 42818821410
Making the projectors' data walked each projector's own syntax and looked up every tile in it for a statics error, on each pass that made the data again, at each worker's answer too, with the statics the same. Its answer is now kept by the projector's very syntax and statics map, and its tile ids by the syntax: at the answer the projectors' data takes 0 to 1 ms (4 on build 38); after an edit, with the statics new, 3 to 6, the check 3 to 4 of it. On a machine between build 37's and build 38's first (the worker's encode 30 to 34 ms, the slide's run 217), the page's work after the picture is 202 to 208 ms at steps 2 to 4, and a drag's view 6.2 ms a frame. After an edit the main view spends 7 to 10 ms with no mark between the editors and the sample focus bar, which build 40 times.22 to 96 ms56.7 fps
view 6.2 ms a frame
WhatWhat it would take away, as measured on build 8Status
2Handle a slider's change event without an edit of the program, as change A did for its input events, or do the edit's work after the paint.Statics and syntax (32 ms) and the whole slide's view (91 ms), all before the paint at 176 ms (build 8).done (b37d2e6df1, build 12): when the compiled run has answered, the page draws first and makes the edit after the paint. A step shows in 19 to 24 ms (the first of four, 124). The edit itself is still made, after the paint (^ticket(721)).
1Draw only the livelits a drag changes: make the editors' and projectors' views incremental.Most of the page's view: 10.1 ms of a 17.1 ms median frame of a drag (build 8); and the whole views after each worker message.first part done (d9d63c13af, build 12): each editor's decorations and probes' views reused across a drag's frames, the view 6.1 ms a frame (8.2 to 10.1 on builds 8 to 11). Then the outline out of the view (bfbd88a1ae, 8bf44f23cf; build 13), built on its own after the paint: the whole views after each worker message 45 to 63 ms (88 to 130 on build 12), a drag's view 4.9 ms a frame. Left: the projector layer, and those whole views. On build 14 the probe on the picture draws its row in 8 to 21 ms after each answer, not 44 to 91 (e1bb06d115). Left: every livelit drawn again when the dynamics are new (4 to 22 ms a view), and a probe's value check, which walks the whole value (4 to 14 ms). Build 15 (a1b43cba46): a livelit keyed on its own statics record, so after an edit only the edited one is drawn again (2 to 3 ms, not 9 to 14); a probe's value check remembered per value (515813903a). Left: every livelit drawn again when the worker's answer brings new dynamics (6 to 15 ms). Build 19 (bd24b35aaa, 1dc99165ba, 854b40ee7d): after each worker answer 4 projectors drawn, not 56 (a livelit kept while what it read of the run is the same by value), and the outline the one before (59 to 82 ms gone, and the page's redraw for it). Left: the outline built again after the edit (55 to 70 ms; its entries the same). Builds 22 and 24 (2b88bf18bf, a1ab2e52d4): the outline drawn after the edit was mostly finding which rows open no cell (32 to 40 ms of 42 to 53, build 21); with a livelit's path found only when a row is inside it, and a tile asked about only when unfinished or a use, that is 11 to 14 ms, and the outline 29 to 32. Left: the rest of that walk, the rows themselves (about 8 ms), and the outline built at all when its entries are the same. Build 26 (3615e5ebb6): the probe's value check answers plain data by its shape, not the step rules: the picture's row after each answer 3 to 6 ms (15 to 35 on build 24), the page's view then 31 to 64 ms (50 to 75). Left: all 53 livelits' views made again at each answer, 2 of them drawn (16 to 41 ms), and the cell's syntax worked out twice there (9 to 26 ms and 9 to 16). Builds 29 to 38 (5fdb0d3004 to 19ecb75694): at the answer the cell's syntax is worked out once; 51 of the 53 livelits keep their finished views, at the answer and after the edit; a use's applied livelit, a shape that does not read the model, the sidebar's problem list and the probes after an edit are all kept; the outline's walk after an edit is kept per top-level tile. The whole view at the answer about 30 to 35 ms (36 to 60 on build 31), the page's work after the picture 167 to 183 ms a step (236 to 300 on builds 25 to 34), a drag's view 6.3 ms a frame (8.2 on build 30). Left: at the answer the projectors' views (8 to 15 ms), the probes (7 to 9), a 20 to 35 ms pause once a step, likely the browser's garbage collection; after an edit the update, statics and syntax cache (16, 16 to 20, 11 to 12), the view (31 to 43) and the outline (18).
3Compile the program once, not again after a step that changed only a livelit's model: keep the compiled program, and give it the new models.126 to 141 ms of the page's thread after each step (build 8).done (7f5add1519, 3e51af567f; builds 9 and 10): kept at every step on the Witch, 5 of 5; 29 to 51 ms of comparing after the paint in place of 126 to 141 ms of compiling. Next: a cheaper comparison, since 22 to 39 ms of it copies the program. The cheaper comparison: done (c016370918, b195b09088; build 17): 1 ms, from 33 to 43, by erasing only what a step changed.
4Leave the worker out when the compiled run has answered: keep the run's answers when the worker catches up, and hold the worker's request until the steps stop.The page drawing every livelit again from the worker's answer, to the same picture; the worker's run for each step of a quick series.partly done (7f5add1519, build 9): the answers are kept each time the worker catches up (10 on the Witch) and its request is held 400 ms. But each of the worker's two messages still costs the page a calculate and a whole view, 95 to 143 ms a view (45 to 63 since build 13 took the outline out), now drawing every livelit from the kept answers. What is left is step 1's. More done (a65a9e5f52, build 14): after a compiled answer, the worker's reuse plan and streams wait for its result, so its first messages no longer cost a calculate and a whole view.
7Send values as data where they cross: the worker's answer and its probe samples without ids, holes or closures.The answer is 0.59 MB, encoded in 67 to 99 ms in the worker and decoded in 18 to 56 ms in the page (builds 9 and 10); the Witch's picture is 3 times smaller as data (^report(47)).first slice tried, and off (1524e96da3, build 11; off since 22cd278106): the values that went as data came back the same, but only 5 a message passed the strict check, and rebuilding the samples lost Marshal's sharing, so the answer grew to 0.89 MB. Now a survey counts why values are not data; next, make data where samples are made (^ticket(718)). Second slice, on (01a5e8ecb0, 66b999aae3, f432751f99; build 20): weighed by part, 112 KB of the 590 KB answer was a final stream the page dropped on arrival, now not sent; and the result's first-order values go as data (17 a result, none different back), its picture among them. The answer 198 KB; the worker's encode 21 to 29 ms (72 to 107), plus 29 to 41 making the data; the page's decode 7 to 8 ms (24 to 31), plus 6 to 17 making terms again. Next: data where samples are made, and kept data on the page. Build 21 times the conversions apart: FirstOrder.of_term 16 to 50 ms in the worker, the check of each value's way back 13 to 64 (only while the check records), to_term 5 to 10 on the page. The next slice waits on ^report(47)'s questions (^ticket(718)).
8The autosave: write the slide's text without printing the whole program again after each step, and its first save after a load without writing everything.37 to 46 ms a second after each step, 27 to 36 of them printing the 2,222 lines again; 287 ms the first time after the slide loads (build 15).started (f4bcd64cf7, build 16): the autosave no longer goes through the update, so the calculate, whole view and outline that followed each one (about 60 ms) are gone. Left: its own 37 to 46 ms, most of it the text, and the first save after a load. Build 23 (263ecc3e84, d68bd6400b): the slide's text prints again only the top-level pieces a step changed, each piece's text kept by its identity: printing 3 to 6 ms (25 to 48 on build 21), the autosave 21 to 31 ms (38 to 67). Left: the items (8 to 11 ms), writing (6 to 10), and the first save after a load.

Not yet started: a check on every PR to dev (step 5), hazel-jit's output more like ReScript's (step 6), and merging the performance PRs open against dev (step 8).

How this was put together#

This report gathers ^report(45) to ^report(50) and adds measurements of its own. The numbers in Node are ^report(45)'s and 046's (Node 22, a laptop, medians of 30 runs); those in Firefox are from scripts/jit_slides.py in jit.yml on GitHub's machines, one run per build: build 8 is 61f3f01a15 (run 42566328043), and today's builds are named where they appear. The compile times in the page come from globalThis.hazelJit.compiles, written by HazelJitValue.note_compile: hazel-jit's part (the term to JS source) and the browser's (new Function, and running a definition's module), with the JS source's size and the term's nodes. One run of a build can differ from the next by a third (^report(50)), so read single runs as such. Firefox reads the page's clock in whole milliseconds on GitHub's machines, so a compilation under a millisecond reads 0 or 1 ms. Today's runs are 42651798712 (7f5add1519, steps 3 and 4) and 42654708022 (3e51af567f, the comparison after the paint, and the compile times); 051/drivers/steps.py reads a run's steps and compilations. The line counts are of the branch at 2342ee7aa1. The generator is 051/gen051.py; every number in the page is also in its embedded data and in 051/data.

The data#