This repository was archived by the owner on Aug 12, 2026. It is now read-only.
Repository navigation
Commit 66f19f8
committed
0017 A: the per-instantiate linker stays, and 0014 C's instantiate figure was C's
0017 A argued stubs must be engine-scoped, on a 7 us upcall stub against a
20 us instantiate. Both numbers were on the wrong side of the boundary.
Measured through cljwit.host itself:
instantiate, no imports 56.9 us
instantiate, one import 73.2 us
So an import costs +16 us -- stub, import reflection and linker registration
together -- on a 57 us baseline, not 7 us on 20.
The prediction recorded before measuring was that reusing one linker across
instantiates would save 2x or more. It works -- wasmtime does not refuse it --
and it saves 1.23-1.45x in C. Falsified.
Against that, engine-scoped stubs need routing through the store data pointer
to reach a per-instance Clojure function, which is exactly where 0018's review
found destructor routing gets hard. So per-instantiate stays, and the falsifier
is named: a component whose own imports number in the dozens. WASI is not one,
because add_wasip2 supplies its interfaces without a stub each.
Separately, 0014 C's cost table said instantiate is 0.02 ms. That is a C
probe's number; this library pays 56.9 us for the same step, because
instantiate makes many FFM calls and each pays the flat crossing 0013 priced.
The ratio the decision rests on survives -- compilation is still 30-300x
instantiation -- but the figure was not ours, which is the same family of
mistake as 0011's whole cost accounting.
That unblocks 0018, which was deferred on this question.
Claude-Session: https://claude.ai/code/session_01XF5Hfq4Ca2N2XYEzWQQuHt1 parent 15191d6 commit 66f19f8
2 files changed
Lines changed: 31 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
| |||
0 commit comments