Hacker News new | past | comments | ask | show | jobs | submit login

> https://stefankrause.net/js-frameworks-benchmark8/table.html

The version of Svelte used there is roughly 100 releases and a year and a half old. These days Svelte's performance appears to be much closer to Inferno's than Preact's.

https://krausest.github.io/js-framework-benchmark/current.ht...




Comparing average numbers in that chart, Preact is 22% faster than React, Svelte is 12.6% faster than Preact and Inferno is 14.5% faster than Svelte. (note: Preact 10.1 is out and this uses 10.0)

    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?


Your total size numbers are almost entirely dominated by Bootstrap and a font, which are the same for all the tests (and not something that would be used on a site where payload size matters). Svelte's JS output, gzipped, is about 40% smaller than Preact and 65% smaller than Inferno.

Assuming those ratios hold up for larger apps, that would be one reason to consider Svelte.


With only 20-ish milliseconds to load, parse, and execute, the size difference disappears into the noise and is irrelevant. In addition, that difference definitely does NOT scale. As you add more components, the ration of component to framework becomes larger and larger as the internal wiring is used over and over again. All those things in the framework have to be re-created quite often in svelte. Even if Svelte could fit all its component changes into the same area as a React-style component (which I doubt), that extra 9 or 21kb would still disappear into irrelevance.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: