radEventListener: Client-side Framework Performance
css-tricks.com
css-tricks.com
1. Vanilla JS is faster than Preact's diff/render.
2. Preact's diff/render is faster than React's.
3. Preact's concurrency model is extremely weak/non-existent.
4. Preact has worse third-party library support than React.
5. Preact is not that much smaller (min-gzip) than React 16.
The conclusion is still the same: use React for UI, don't bother with React-family libraries. Use vanilla JS for games, canvas, and other web APIs that aren't UI.More info: https://preactjs.com/guide/v10/differences-to-react/#main-di...
Choosing React over vanilla JS is not only required for simple state things imho - for complex state I'd even say some may use something like Redux/MobX. The development experience and speed vs vanilla JS is just unmatched. The amount you need to worry about adding / removing classes, with implicit state all over the place will soon slow you down soon much because of all the edge cases you haven't thought of.
I hope nobody starts off development for new apps in 2020 based on pure JS - even if you explicit target ultra-low-end devices, maybe try a lighter framework like preact (et al).
(Submitted title was 'Vanilla JavaScript renders 5-10x faster than Preact, 30x faster than React'.)
Also preact are very often simply not work, i can't explain, but it is always something really creepy happening in random places. Event listeners also behave somehow different.
Also React 17 sets only a single listener to a document, not everywhere and adding a lot of listeners is much cheaper now.
At the same time most of the react slowness is not from react, but from awful libraries, usually css-in-js. And concept of css-in-js is actually very good, but implementations are simply awful.