A live demo for this post can be found here.
Recently I’ve been playing with Yew, a web framework written in Rust that compiles to WebAssembly. It borrows the Elm model (
update) and adds a JSX-like syntax on top of it. At first I was leaning to another framework, Seed, that is literally Elm in Rust if you have a quick look at the syntax, but I ended up with Yew. While they are both amazing, Yew seemed a bit more mature to me (although a bit lacking in documentation) and the JSX syntax is a big selling point.
<div>, each one with an attached event handler that toggled a class on
mouseleave. As I played with it, I was baffled by how slow the framework applied the class as I moved the pointer over the grid. I couldn’t believe it: the model was embarrassingly simple, I was not passing around big objects by copy, the view’ elements were properly keyed. What now?
Since I did not know if it was a problem regarding my (probably horrible) implementation, I decided to port the exact same project to Elm and check the result. It was amazingly fast and responsive, just as I expected the Yew app to be. At this point I decided to postpone playing with Yew and created an app that compares the two implementations, and it works as some kind of visual benchmark. You can check it out here.
If you spot the performance issues in the Yew app, please open an issue in the repo. I will be more than happy to fix it, and give Yew the justice it deserves :)