3 ms·
There's an interesting link in these UI patterns: Code clarity and performance. For example, comparing a virtual DOM model with manual UI changes: Deliberate U
by the__alchemist 6y ago
There's an interesting link in these UI patterns: Code clarity and performance.
For example, comparing a virtual DOM model with manual UI changes: Deliberate UI changes, if done well (The article mentions they're often not) are faster... at the expense of losing the elegant model of declarative UI. VDOMs conduct many more operations than are required, but allow you to describe how the UI should behave elegantly.
As the article mentions, Svelte is a cool approach that attempts to reconcile this. Personally, I wrote a React/Elm-like WASM framework in Rust. After stepping back, I'd only use something like that for complex, non-performance-critical UIs. In embedded or simple websites, that sort of overhead isn't appropriate, even though it leads to nice code.
I think we'll be able to dodge this compromise soon. Maybe with something like Svelte, or maybe with a different approach.