The Truth about Rust/WebAssembly Performance

Channel:Greg Johnston · Length:29:47 · Published:2023-03-17 · Views:218515

Watch on YouTube

Summary

Leptos creator Greg Johnston examines Rust/WebAssembly frontend frameworks against JavaScript frameworks using the JS framework benchmark. He argues that WASM is no longer too slow for DOM-heavy rendering.

Why HN recommends it

Cited as evidence that DOM access is not the bottleneck for WebAssembly, and as an explanation of signals-based updates versus virtual DOM.

did a pretty good video about this a few weeks ago[0] — HN, 2023

C, C++, Rust, Go & systems languages · Web development · Software performance & optimization

Subtitles (excerpt)

hey this is Greg creator of the leptos web framework for rust today we're going to talk about the truth about rust and webassembly performance now to be clear I'm only talking about webassembly performance for rendering in the browser I'm not talking about things like wasm Edge run times and so on I'm talking specifically about the performance of compiling a rest application to webassembly and using it to render a user interface in your browser but I often see in these conversations a few myths so I thought it'd be helpful to kind of walk through them and talk about the truth about webassembly performance myth number one is that webassembly is amazing rust is much faster than JavaScript so webassembly should be faster than JavaScript and it will take over the world in fact you'll use webassembly to render directly into the canvas we'll skip HTML CSS JavaScript altogether there are a number of reasons I don't think this is the right approach for us to be taking but the basic truth is Javascript can be quite fast when it's just in time compiled and optimized by you know the V8 engine or in the browser it runs pretty well webassembly can run just as fast and there are certain tasks webassembly can do much faster but in terms

On Hacker News

[VIDEO] This video might be helpful. Leptos uses Signals, borrowing ideas from SolidJS to update the DOM. There's no VirtualDOM like React. Svelte also doesn't use a VDOM. When there's a state change React has to rerender the entire VDOM tree and the diff it with the real DOM, whereas using the Signals model those frameworks make the change directly in the real DOM. I'm not sure how Svelte manipu… — theironhammer, 2023-07
Greg Johnston, author of the Leptos framework, did a pretty good video about this a few weeks ago[0]. The TLDR is (of course): it depends. WASM has no native access to the DOM, so all DOM manipulations from wasm-land have to go through JS bindings with all the (de)serialisation costs that go with crossing the language boundary. That eats up a lot of whatever performance gains you'd see from rust-… — pdpi, 2023-04
> no DOM access meant the only viable use cases were compute-heavy workloads like codecs and crypto, no, it didn't mean that, because the overhead is not a deal breaker: 1) you don't have to do the glue code (libs can do it for you) 2) there's overhead due to glue, but the overhead is so small that WASM web frameworks easily can compete with fast JS frameworks in DOM heavy scenarios. Source: Anal… — tcfhgj, 2026-03
the JS layer is slow, indeed, but it shouldn't be that much slower that it meaningfully impacts frontend apps A demonstration of that by the creator of Leptos: [VIDEO] — tcfhgj, 2026-02
The founder of Leptos makes a pretty good argument [1] that the bottleneck for WASM isn't really the DOM and that they are already faster than some popular JS frameworks even with the current constraints. [1] [VIDEO] — jbjohns, 2024-10

Related videos