by hajile · 6y ago · 0 comments
Vanilla JS 1.04 (5.8% faster than Inferno)
Inferno JS 1.10 (14.5% faster than Svelte)
Svelte JS 1.26 (12.6% faster than Preact)
Preact JS 1.42 (22% faster than React)
Total Size isn't that different either. That's an 11% payload difference between Inferno and Svelte and a less than 5% difference with Preact and Svelte. This isn't surprising since Preact is about 9kb unzipped (less than 4k zipped) and Inferno is about 21kb unzipped (less than 9k zipped). Vanilla JS 144kb
Inferno JS 163kb
Svelte JS 146kb
Preact JS 153kb
Maximum memory difference between Svelte and Inferno is negligible too at only 9%. I'd argue that memory usage for any of these will be dwarfed by actual data and the DOM itself. Preact memory usage is interesting as it uses more than Inferno despite not having to diff against a vdom. Vanilla JS 3.3mb
Inferno JS 4.8mb
Svelte JS 4.4mb
Preact JS 7.5mb
Startup time (parse to first load) is also completely unimportant with Svelte at about 1.2ms faster than Inferno, but 1ms slower than Preact (which even beats out the fastest vanillaJS version). Vanilla JS 20.3ms
Inferno JS 21.6ms
Svelte JS 20.4ms
Preact JS 19.4ms
Even the pessimistic responsiveness isn't very different with svelte being about 8% faster than Preact or Inferno. Vanilla JS 1882ms
Inferno JS 2033ms
Svelte JS 1883ms
Preact JS 2031ms
Inferno and Preact both have access to the wide support of the React ecosystem and tooling. Inferno is faster overall while not being particularly worse in any single area and better in others compared to Svelte.Why would I want to choose Svelte?
Assuming those ratios hold up for larger apps, that would be one reason to consider Svelte.