Skip to main content

Crate zdc_bench

Crate zdc_bench 

Source
Expand description

The benchmark suite §14A.4 makes a deliverable.

What this measures. Operation counts, not time. The workload runs in a pure-Rust JavaScript interpreter embedded in a cargo test, and a wall-clock number from there is not comparable to a browser — reporting one as if it were would be dishonest. What is comparable is how many times each arm crosses into the DOM, how many nodes it allocates, how many effects it creates, and how many times those effects re-run. Those counts are the same in this interpreter as in V8, because they are a property of the emitted code rather than of the engine.

What it cannot measure. React and SolidJS. §14A.4 asks for both, and both need a package manager: CI has no network and §8 forbids a Node dependency. The arms that stand in their place are a direct-emission generator (the design §16.1 rejected) and two hand-written vanilla implementations, one naive and one tuned. Nothing here should be read as a measurement against React or Solid.

The gap. each in the view is refused by this compiler (§16.5, M5b), so the workload’s list cannot be written in ZDeceptron today. The row body in js/benchmark.js is the compiler’s own emission for bench/row.zdtests/fidelity.rs proves it, and fails the build if it drifts — but the eachInto around it is written by hand. See BENCHMARKS.md.

Structs§

BundleSize
One compiled example, in bytes.
Emitted
One program, compiled, in Swift’s units.
GraphTimes
What the two graph passes cost on one program.
Measurement
One arm’s counts for one operation.
Report
Every measurement, in the order the workload produced them.
RowShape
The parts of a row emission that determine what the row costs.

Constants§

BENCHMARK_JS
The workload: five arms, ten operations, one DOM.
DOM_SHIM_JS
The minimal DOM the runtime’s own tests run against.
END_MARKER
FOREIGN_VIEW_PROGRAM
The null program plus the one construct that links foreign.js.
INSTRUMENT_JS
Counting instrumentation layered over the runtime’s DOM shim.
NULL_PROGRAM
The empty-program baseline, in Swift’s shape.
REORDER_JS
Reordering, counted: two reconcilers, four shapes, three sizes.
ROW_ZD
One js-framework-benchmark row, in ZDeceptron.
SMALLEST_PROGRAM
The smallest program the compiler will build at all.
START_MARKER
SWIFT_BYTES_PER_LINE
Swift’s headline: bytes of JavaScript per line of application source.
SWIFT_LARGEST_APP_JS
Shop’s emitted JavaScript, in bytes.
SWIFT_LARGEST_APP_LINES
Swift’s largest application, Shop.
SWIFT_NULL_PROGRAM_JS
Swift’s null program, in bytes.
SWIFT_NULL_PROGRAM_LINES
Swift’s null program: 6 lines in, 73 kB of JavaScript out.

Functions§

benchmark_row
The shape of the row the benchmark’s ZDeceptron arm renders.
build
Compile a source that is expected to build, or explain what refused it.
bundle_sizes
Every example this compiler can build today, sized.
code_lines
A ZDeceptron source line that carries a program.
compile
Compile a file in the repository, or fail with every diagnostic.
deepest_fold
How many elements an index-recursive fold gets through before the host refuses.
emitted_row
The shape of the row the compiler emits for bench/row.zd.
generated_section
The whole generated region of BENCHMARKS.md.
linked_runtime_bytes
The runtime files one bundle actually links, in bytes.
linked_runtime_bytes_in
The same, for whichever build is asked about.
program_with_components
count instantiations of a chain of components depth deep.
program_with_depth
A view nested n elements deep around a single leaf.
program_with_roots
defs shared definitions reachable from each of roots roots.
program_with_signals
n client signals, each declared once and read once in the view.
program_without_components
The same view with the components written out by hand.
repository_path
run
Run the workload and collect every arm’s counts.
run_reorder
Count the moves a reorder costs, at three sizes and in four shapes.
runtime_js_bytes
The runtime a program that renders a view and nothing else links.
survey
Every example that builds, sized; and every one that does not, with why.
template_bytes
The bytes a module spends on static markup.
time_graph_passes
Time split and ifc separately, averaged over reps runs.
try_compile
Run the whole pipeline over a source, keeping the diagnostics.