# Weft performance Measurements used the private-ballot example on one Apple Silicon macOS host, Clang with `-O3`, Z3 4.15.4, Wasmtime 38, and headless Chrome 158. Both versions prove the same 70 ballot obligations. Absolute timings vary with hardware, load, component size and proof complexity. | Workload | Original Python toolchain | C toolchain | | --- | ---: | ---: | | In-memory parse, type check and WASM emission | 1.170 ms | 0.035 ms | | Complete verified build, including process startup and output | 595 ms | 67 ms | | Recheck the identical original artifact, including process startup | 596 ms | 76 ms | | Chrome call to the WASM choice transition | 40 ns | 38 ns | | Chrome synthetic choice click, including synchronous DOM work | 136 µs | 107 µs | The compiler improvement shows up most clearly in verified builds. The two browser modules already run as machine code in Chrome. Direct browser WASM calls had overlapping sample ranges. The browser adapter now caches export handles and writes only changed view values and enabled flags. The click measurement includes form validation, dispatch and DOM updates. It excludes painting a frame, human input latency and HTTP delivery. The native Wasmtime host measured **50 ns per pre-resolved choice dispatch**. Running the original binary in the new host also measured 50 ns. The old Python host's public dispatch API measured 112 µs and included name lookup, Python argument and result conversion, and construction of an outbox dictionary. These headless measurements exercise different host APIs. The 50 ns result applies to a hot, enabled local event with four state fields and two empty recipient slots. Events that require entropy, transport, rendering, or output formatting have additional costs. ## Reproduce the workloads ```sh make bench make test make browser-test ``` The frontend benchmark discards one warm-up batch and takes five batches of 100 parses and compilations from in-memory source. The headless benchmark takes five one-million-call samples after warm-up. The browser test measures one million direct WASM calls and 1,000 native-button clicks per sample, checks a checksum and the final rendered state, then exercises both recipient inboxes. The table reports medians. The comparative CLI measurements alternated the order of the two versions, discarded the initial pair, and used seven fresh-process samples per command. Each build produced its own artifact. Both check commands read the same original 410-byte module and receipt. Measured ranges were 493–740 ms and 49–98 ms for builds, and 511–689 ms and 59–145 ms for checking. The new ballot module is 404 bytes. The server-owned vault example went from 141 to 131 bytes. Set `WEFT_TIMING=1` to print the frontend and verification phases of a build in isolation. Verification time includes source obligations, artifact decoding, binary refinement and receipt construction. A running component pays these costs once at admission.