WebAssembly component size

Each example implements the same click counter: one button starts at “Clicks: 0” and increments when clicked. Kaja uses a custom element; Yew, Leptos, and Dioxus render their equivalent framework component.

Size in kilo bytes, smaller is better.

Framework Uncompressed .wasm (kB)
Kaja97 kB
Leptos155 kB
Yew221 kB
Dioxus705 kB

Conclusion all binaries are small but KajaWeb produces the smallest binaries.

Code samples

Runtime performance

Handling 250 clicks in the component. Faster is better.

Framework Startup median (ms) Click batch median (ms) Median per click (µs)
Kaja26.102.208.80
Yew33.4016.6066.40
Leptos33.4016.5066.00
Dioxus50.3016.3065.20

All frameworks are very fast. Kaja Web is fastest framework in this benchmark but minor tweaks to the code under test changes the benchmarks considerably, take this benchmark with a grain of salt.

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
Github: johanmattssonm
Linkedin: johan-mattsson-2ab324112