maciejhirsz / kobold

Easy declarative web interfaces.
https://docs.rs/kobold/
Mozilla Public License 2.0
385 stars 7 forks source link

Add persistence in localStorage to TodoMVC #35

Closed gbj closed 1 year ago

gbj commented 1 year ago

I sensed from your blog post that you might be interested in using TodoMVC as a benchmark for WASM binary size comparisons across frameworks. I think this is is a great idea, since TodoMVC is pretty ubiquitous as a small-but-reasonable app example, and did some similar comparisons a couple years ago.

I'd note that if you want to compare across frameworks you should either add persisting serialized todos to localStorage (see TodoMVC spec) or remove it from other frameworks before comparing, since serde_json tends to make up a pretty large fraction of binary size for typical Rust/WASM apps.

maciejhirsz commented 1 year ago

Oh yea, I'm aware. Persistence is there, I just do manual serialization in place of serde since I wanted to see how far I can push it. The code for that is really simple so I didn't felt like I was cheating too much, but I also intentionally didn't mention any Wasm sizes produced by other crates in the blog since it wouldn't be fair :upside_down_face:.

If we are to use TodoMVC as a sort of benchmark for Wasm size in Rust world, I reckon doing so without serialization might be best since that's a better metric for the framework itself. The addition of serde is basically just a fixed tax on size: the gap in binary size in absolute numbers would be roughly the same with or without it, but relative numbers would be brought closer together.

gbj commented 1 year ago

Great! I missed the gloo_storage dependency there :-)