Roc Solid
Markup in Roc · pages on a native server · components in WebAssembly

Examples · Benchmarks

Roc Solid in js-framework-benchmark

js-framework-benchmark is the yardstick most web frameworks are measured with: one page, a table of rows and six buttons. Its runner opens each framework's page in Chrome, clicks, and times until the page has painted; it also measures memory and downloads. Roc Solid's two entries are in benchmarks/jsframework/, here beside vanillajs (the floor: hand-written DOM code), Solid (the closest relative), Leptos (signals in Rust and wasm), Joy (the other Roc framework) and React.

At a glance#

Each entry in six categories, as times the best entry in it (1× is the best), and the official ranking's measure: the CPU benchmarks' slowdown against each one's fastest. The switch in the corner shows the values instead. Lower is better; green is close to the best, red many times it.

Ready to usemsFirst paintmsMaking rowsmsUpdating rowsmsMemoryMBDownloadKB OverallCPU, official
vanillajskeyed 1.10× 21.6 ms1.34× 40.7 ms1.07× 35.6 ms1.00× 11.2 ms1.00× 0.9 MB1.04× 2.5 KB 1.08× 18.8 ms
vanillajsnon-keyed 1.00× 19.5 ms1.48× 44.9 ms1.00× 33.3 ms1.13× 12.7 ms1.02× 0.9 MB1.00× 2.4 KB 1.13× 19.5 ms
Solidkeyed 2.27× 44.3 ms1.54× 46.7 ms1.13× 37.6 ms1.11× 12.4 ms1.24× 1.1 MB1.88× 4.5 KB 1.17× 20.3 ms
Joynon-keyed 9.11× 177.9 ms5.41× 164.2 ms1.13× 37.8 ms1.13× 12.7 ms1.34× 1.1 MB19.75× 47.4 KB 1.19× 20.6 ms
Joykeyed 8.98× 175.5 ms5.34× 162.2 ms1.34× 44.7 ms1.13× 12.7 ms1.34× 1.2 MB19.75× 47.4 KB 1.28× 22.2 ms
Leptoskeyed 11.75× 229.5 ms7.09× 215.3 ms1.31× 43.6 ms1.18× 13.2 ms1.39× 1.2 MB20.33× 48.8 KB 1.30× 22.4 ms
Roc Solidnon-keyed 12.73× 248.7 ms1.36× 41.2 ms1.67× 55.6 ms1.42× 15.9 ms2.34× 2.0 MB26.38× 63.3 KB 1.61× 27.8 ms
Roc Solidkeyed 13.41× 262.0 ms1.00× 30.4 ms2.09× 69.6 ms1.28× 14.4 ms2.38× 2.0 MB28.21× 67.7 KB 1.68× 29.0 ms
Reactkeyed 10.78× 210.6 ms6.47× 196.5 ms1.43× 47.7 ms1.79× 20.1 ms2.47× 2.1 MB21.42× 51.4 KB 1.70× 29.5 ms

First paint and ready to use. The runner times the first paint alone. Roc Solid's page is HTML the server rendered, so the browser paints it at once, the best of them; its buttons answer once the runtime and the wasm have come and hydrated the page, the last of them here. The benchmark's server compresses each file as it sends it (brotli, at its slowest), one at a time, which costs by the raw byte, and Roc Solid's page has the most of them: from a server that sends files compressed beforehand, as a deployment does, the wait is much shorter. Ready to use is measured here, beside the runner: a cold load, five times, until the buttons answer.

Roc Solid against each#

Each other entry against Roc Solid's of the same kind (keyed or not), in words.

Roc Solid (keyed) against vanillajs (keyed)

  • Ready to use 12× later 262.0 ms against 21.6 ms
  • First paint 1.3× sooner 30.4 ms against 40.7 ms
  • Making rows 2.0× slower 69.6 ms against 35.6 ms
  • Updating rows 1.3× slower 14.4 ms against 11.2 ms
  • Memory 2.4× more 2.0 MB against 0.9 MB
  • Download 27× larger 67.7 KB against 2.5 KB
  • Overall (CPU) 1.5× slower 1.68× against 1.08× the fastest

Roc Solid (non-keyed) against vanillajs (non-keyed)

  • Ready to use 13× later 248.7 ms against 19.5 ms
  • First paint 1.1× sooner 41.2 ms against 44.9 ms
  • Making rows 1.7× slower 55.6 ms against 33.3 ms
  • Updating rows 1.3× slower 15.9 ms against 12.7 ms
  • Memory 2.3× more 2.0 MB against 0.9 MB
  • Download 26× larger 63.3 KB against 2.4 KB
  • Overall (CPU) 1.4× slower 1.61× against 1.13× the fastest

Roc Solid (keyed) against Solid (keyed)

  • Ready to use 5.9× later 262.0 ms against 44.3 ms
  • First paint 1.5× sooner 30.4 ms against 46.7 ms
  • Making rows 1.9× slower 69.6 ms against 37.6 ms
  • Updating rows 1.2× slower 14.4 ms against 12.4 ms
  • Memory 1.9× more 2.0 MB against 1.1 MB
  • Download 15× larger 67.7 KB against 4.5 KB
  • Overall (CPU) 1.4× slower 1.68× against 1.17× the fastest

Roc Solid (keyed) against Leptos (keyed)

  • Ready to use 1.1× later 262.0 ms against 229.5 ms
  • First paint 7.1× sooner 30.4 ms against 215.3 ms
  • Making rows 1.6× slower 69.6 ms against 43.6 ms
  • Updating rows 1.1× slower 14.4 ms against 13.2 ms
  • Memory 1.7× more 2.0 MB against 1.2 MB
  • Download 1.4× larger 67.7 KB against 48.8 KB
  • Overall (CPU) 1.3× slower 1.68× against 1.30× the fastest

Roc Solid (keyed) against Joy (keyed)

  • Ready to use 1.5× later 262.0 ms against 175.5 ms
  • First paint 5.3× sooner 30.4 ms against 162.2 ms
  • Making rows 1.6× slower 69.6 ms against 44.7 ms
  • Updating rows 1.1× slower 14.4 ms against 12.7 ms
  • Memory 1.8× more 2.0 MB against 1.2 MB
  • Download 1.4× larger 67.7 KB against 47.4 KB
  • Overall (CPU) 1.3× slower 1.68× against 1.28× the fastest

Roc Solid (non-keyed) against Joy (non-keyed)

  • Ready to use 1.4× later 248.7 ms against 177.9 ms
  • First paint 4.0× sooner 41.2 ms against 164.2 ms
  • Making rows 1.5× slower 55.6 ms against 37.8 ms
  • Updating rows 1.3× slower 15.9 ms against 12.7 ms
  • Memory 1.8× more 2.0 MB against 1.1 MB
  • Download 1.3× larger 63.3 KB against 47.4 KB
  • Overall (CPU) 1.3× slower 1.61× against 1.19× the fastest

Roc Solid (keyed) against React (keyed)

  • Ready to use 1.2× later 262.0 ms against 210.6 ms
  • First paint 6.5× sooner 30.4 ms against 196.5 ms
  • Making rows 1.5× slower 69.6 ms against 47.7 ms
  • Updating rows 1.4× faster 14.4 ms against 20.1 ms
  • Memory about the same 2.0 MB against 2.1 MB
  • Download 1.3× larger 67.7 KB against 51.4 KB
  • Overall (CPU) about the same 1.68× against 1.70× the fastest

Each category#

Ready to use, ms: a cold load until the buttons answer
  1. vanillajs (non-keyed) 19.5
  2. vanillajs (keyed) 21.6
  3. Solid (keyed) 44.3
  4. Joy (keyed) 175.5
  5. Joy (non-keyed) 177.9
  6. React (keyed) 210.6
  7. Leptos (keyed) 229.5
  8. Roc Solid (non-keyed) 248.7
  9. Roc Solid (keyed) 262.0
First paint, ms: a cold load until the browser first paints
  1. Roc Solid (keyed) 30.4
  2. vanillajs (keyed) 40.7
  3. Roc Solid (non-keyed) 41.2
  4. vanillajs (non-keyed) 44.9
  5. Solid (keyed) 46.7
  6. Joy (keyed) 162.2
  7. Joy (non-keyed) 164.2
  8. React (keyed) 196.5
  9. Leptos (keyed) 215.3
Making rows, ms: create, replace, create 10,000, append
  1. vanillajs (non-keyed) 33.3
  2. vanillajs (keyed) 35.6
  3. Solid (keyed) 37.6
  4. Joy (non-keyed) 37.8
  5. Leptos (keyed) 43.6
  6. Joy (keyed) 44.7
  7. React (keyed) 47.7
  8. Roc Solid (non-keyed) 55.6
  9. Roc Solid (keyed) 69.6
Updating rows, ms: update, select, swap, remove, clear
  1. vanillajs (keyed) 11.2
  2. Solid (keyed) 12.4
  3. Joy (keyed) 12.7
  4. vanillajs (non-keyed) 12.7
  5. Joy (non-keyed) 12.7
  6. Leptos (keyed) 13.2
  7. Roc Solid (keyed) 14.4
  8. Roc Solid (non-keyed) 15.9
  9. React (keyed) 20.1
Memory, MB: ready, with 1,000 rows, after creating and clearing
  1. vanillajs (keyed) 0.9
  2. vanillajs (non-keyed) 0.9
  3. Solid (keyed) 1.1
  4. Joy (non-keyed) 1.1
  5. Joy (keyed) 1.2
  6. Leptos (keyed) 1.2
  7. Roc Solid (non-keyed) 2.0
  8. Roc Solid (keyed) 2.0
  9. React (keyed) 2.1
Download, KB: everything the page loads, compressed
  1. vanillajs (non-keyed) 2.4
  2. vanillajs (keyed) 2.5
  3. Solid (keyed) 4.5
  4. Joy (keyed) 47.4
  5. Joy (non-keyed) 47.4
  6. Leptos (keyed) 48.8
  7. React (keyed) 51.4
  8. Roc Solid (non-keyed) 63.3
  9. Roc Solid (keyed) 67.7

All the numbers#

Every benchmark, in milliseconds, megabytes and kilobytes: each mean over 2 rounds of 15, with its standard deviation

Each cell is the mean of every iteration of both rounds, its standard deviation under it, coloured by how many times the row's best it is. The runner slows the CPU down for three of them, as its id says ( _x16 is sixteen times slower), so small differences show.

CPU, milliseconds
Benchmark Roc SolidkeyedRoc Solidnon-keyedvanillajskeyedvanillajsnon-keyedSolidkeyedLeptoskeyedJoykeyedJoynon-keyedReactkeyed
create rows01_run1k 36.1± 0.736.5± 0.818.5± 0.618.8± 0.719.6± 0.422.4± 1.323.5± 0.723.4± 0.422.4± 0.5
replace all rows02_replace1k 40.5± 0.515.6± 1.619.6± 0.714.8± 3.521.7± 1.825.7± 0.525.1± 0.612.6± 2.427.3± 2.3
partial update03_update10th1k_x16 20.6± 5.420.9± 7.713.2± 4.215.9± 5.617.3± 5.814.9± 5.417.0± 5.216.2± 4.816.5± 3.7
select row04_select1k 6.2± 3.76.1± 4.07.1± 5.28.0± 4.87.3± 4.78.0± 4.87.2± 3.67.0± 4.79.1± 3.3
swap rows05_swap1k 22.8± 7.621.1± 13.416.1± 5.814.3± 6.115.7± 4.818.0± 6.017.4± 5.015.6± 6.188.8± 3.4
remove row06_remove-one-1k 14.2± 3.025.5± 1.011.5± 3.417.8± 0.913.9± 4.012.9± 4.514.7± 4.818.1± 1.015.6± 2.9
create many rows07_create10k 381.3± 12.8397.6± 12.9199.7± 4.4203.9± 2.9214.3± 5.4249.2± 6.6260.0± 5.1262.7± 9.0330.0± 24.7
append rows to large table08_create1k-after1k_x2 42.1± 0.842.3± 1.022.2± 3.421.8± 2.621.9± 0.825.1± 0.726.2± 0.526.2± 0.525.6± 0.7
clear rows09_clear1k_x8 15.0± 1.014.9± 0.910.3± 2.710.2± 2.310.7± 2.214.5± 1.710.4± 2.510.5± 2.515.6± 0.9
Memory, megabytes
Benchmark Roc SolidkeyedRoc Solidnon-keyedvanillajskeyedvanillajsnon-keyedSolidkeyedLeptoskeyedJoykeyedJoynon-keyedReactkeyed
ready memory21_ready-memory 1.1± 0.01.0± 0.00.60.60.60.6± 0.00.70.7± 0.01.1
run memory22_run-memory 4.5± 0.04.5± 0.01.9± 0.01.82.7± 0.02.6± 0.02.42.44.4± 0.0
creating/clearing 1k rows (5 cycles)25_run-clear-memory 1.7± 0.01.80.6± 0.10.6± 0.00.81.0± 0.10.9± 0.00.9± 0.01.9± 0.0
What the page loads, kilobytes, and its first paint, milliseconds
Benchmark Roc SolidkeyedRoc Solidnon-keyedvanillajskeyedvanillajsnon-keyedSolidkeyedLeptoskeyedJoykeyedJoynon-keyedReactkeyed
uncompressed size41_size-uncompressed 260.0 KB244.2 KB11.3 KB12.0 KB11.5 KB189.6 KB148.1 KB147.9 KB190.3 KB
compressed size42_size-compressed 67.7 KB63.3 KB2.5 KB2.4 KB4.5 KB48.8 KB47.4 KB47.4 KB51.4 KB
first paint43_first-paint 30.4 ms± 1.741.2 ms± 9.840.7 ms± 6.744.9 ms± 1.746.7 ms± 0.5215.3 ms± 3.7162.2 ms± 1.5164.2 ms± 0.6196.5 ms± 1.3

Measured on 2026-11-26: Roc Solid at commit 505b0e7, krausest/js-framework-benchmark 0f4e789, Chrome 158.0.8127.88 headless, in 71 minutes, the machine's load average 10.4 → 5.8 meanwhile, on mains. Compare the entries with each other rather than with another machine's numbers, or the official table's.

Ran on

Machine
MacBook Pro (Mac17,2)
Processor
Apple M5 (arm64)
Cores
10 (4 performance, 6 efficiency)
Memory
32 GB
Storage
SSD, APFS
System
macOS 27.0.1
Power
mains

What they say#

The run shown is of the browser's old runtime, runtime.js. Since D-158 the browser runs on rocx-engine, the Rust engine the server and the phones run, inside the wasm. Measured beside runtime.js in a shorter run of the same runner: CPU 0.92× runtime.js's, clearing rows 0.84×, replacing them 0.89×, updating every tenth row 1.28× (a few slow samples among fast ones); memory after five lists made and cleared 1.0 MB against 1.9. The runner's full run, beside the other frameworks, waits for a quiet machine.

The first paint is the best of them: the page is server-rendered HTML (here, files written by rocx build --static), shown before its wasm loads. Ready to use is the reverse: the page answers a click only once the runtime and the wasm have arrived and hydrated it. On the benchmark's server, which compresses each file slowly as it sends it, that is the last of them. The download is most of that: the runtime ships only what the page uses (D-087), 128 KB of its 180 in the run shown, but with the wasm it is still more than Joy's, Leptos's or React's, and many times Solid's, which is JavaScript alone.

Updating existing rows is close to the others: a row's holes rerun only when its data changed (compared with ==), selecting one runs the two rows it leaves and comes to (create_selector!, D-083), and a swap moves the two rows that moved. Making rows is slower: about twice vanillajs, for 1,000 rows and for 10,000. A row is a template (D-084): its markup comes once, and each row is a copy with its parts put in, so Roc builds no markup beyond its holes. But each hole is its own computation, run by a call into the wasm (with the engine, a call from Rust into Roc inside it), noting what it read for the next change; vanillajs writes the text and is done. Memory follows: a computation for the row and each hole, each with what it read. The repository's TODO.md lists what is left.

How CPU time got here, against the fastest:

The entries#

Each entry is a one-page app with the vanillajs entry's markup (the runner finds buttons by id and rows by class). keyed keeps each row by its id (.map with key={row.id}), so a row moves with its data; non-keyed keeps a row by position (.map_with_index with key={i}), so a swap rewrites the two rows instead. The rows' data is plain Roc (Rows.roc): an id and a three-word label from a fixed-seed generator. Nothing is batched or cached beyond what an app would do, and the wasm is built as an app ships it.

The others are the benchmark's own entries, built as its README says (Leptos's build is in its repository). Joy's entries aren't in the benchmark yet; they're built from its 0.35.0 release as Joy's benchmarks/jsframework/README.md says. Upstream retired its non-keyed entries in October 2026, but its runner still measures them, so ours, Joy's and vanillajs's are kept.

Run it#

The benchmark lives outside the repository, in a clone of krausest/js-framework-benchmark with its runner installed, the other entries built and a Chrome for the runner; set it up once, as benchmarks/jsframework/README.md says. The runner needs a small patch (in the same folder): it counted events from before tracing began as the click's. Then:

just js-bench entries   # Roc Solid's two entries, built into the clone
just js-bench bench     # them, then two rounds of every entry (about 75 minutes)
just js-bench bench --rounds=1 --count=3 --benchmarks=01_,05_   # a quick look

The runner is headless, the benchmark's server on port 8089; each round runs one benchmark at a time for every entry, the second round in reverse order. Run it on mains, with nothing else heavy running. Results land in site/js-framework-benchmark.json, which this page reads. Like the examples' numbers, they're measured only when asked, never by the site's build.