3 ms·
Inferno is 11% larger bundle size, but is faster at all the things but one (the loss is less than 1/5 the margin of error) while using less memory too. It doesn
by hajile 6y ago
Inferno is 11% larger bundle size, but is faster at all the things but one (the loss is less than 1/5 the margin of error) while using less memory too. It doesn't take too much more code to make up a mere 17kb size difference.
Preact is 4.8% larger bundle size and a bit slower, but since the unzipped framework is around 6kb, it takes very little code to flat-out beat Svelte in bundle size (there's a mere 7kb difference which decreases with each new component).
Both of these allow you to use the numerous React libraries out there. The added productivity from using these is often going to result in tens or hundreds of thousands less money spent on the project. If they add substantially to the bundle size, then you rapidly cross the point where Svelte is both more code and (in the case of Inferno) also slower.
- pier25 6y agoI've used Inferno on a couple of projects. It is faster, but the difference with Svelte is negligible in real world usage. Even in scenarios that really push the perf (eg: realtime visualizations) Svelte works beautifully. The big point you're missing in your analysis is that in a real world app Inferno or Preact won't be sufficient to do your job. For example will you probably add other packages to manage state (eg: MobX) or do transitions. Maybe little utilities like classnames[1]? Svelte already includes all those by default. I will agree there is a sweet spot around 150-200kB where you could get away with Inferno/Preact/etc without code splitting and the Svelte bundle would be higher. In practice you're not very likely to hit the inflection point of Svelte. For bigger projects you'd be using code splitting anyway, with any framework (unless you're some kind of savage). > Both of these allow you to use the numerous React libraries out there. It's true the Svelte ecosystem is small, but that advantage depends a lot on what you're building. It would certainly be risky to use Svelte for an enterprise app, which tend to be more generic. OTOH if you have custom requirements all those react libraries are pretty much useless. Also, if this argument had any real weight for dismissing Svelte entirely we'd still be using jQuery. Today the Svelte ecosystem looks very much like the React ecosystem when I started using it 5 years ago and look where we are now. React was experimental back then and now its become the choice for enterprise. [1] https://www.npmjs.com/package/classnames https://www.npmjs.com/package/classnames