Stefan Krause, a developer, publishes benchmarks comparing the performance of JavaScript frameworks, and has also looked at WebAssembly and the JVM.
HN commenters cite his js-framework-benchmark results to compare framework speed and memory use, including Vue, Mithril, and React, and his JVM post on stack allocation.
https://stefankrause.net/js-frameworks-benchmark8/table.html
Preact diffs against the real dom and is faster than Svelte in benchmarks while the library is only around 3.5kb (the minified code fits easily on a single screen). I'd note that authors from most of the frameworks represented have submitted their own optimizations, so performance isn't strictly based on the author's familiarity.
InfernoJS is massively faster than Svelte or Preact (the benchmark author had to do some rather convoluted re-writes of vanillaJS over the years to keep ahead) and it uses a virtual DOM, but has a few optimizations that React doesn't have or can't use due to its external API.
stdweb is the real thing to keep your eye on as it seems to show that WASM can be every fast. They still haven't gotten the vanilla benchmark up to the same speed.
https://stefankrause.net/js-frameworks-benchmark8/table.html
React's Fibers do some cool batching behind the scenes which means that large updates (especially constant ones like animations) don't have large negative impacts on user interaction. I doubt this would be possible without a vdom or something very similar to track all changes before deciding batches and update priority.
Also, remember that vdoms have gotten a lot more efficient too. Newer ones can do things like re-use existing sub-trees or recycle vdom objects (they can also recycle the associated real DOM nodes too). Preventing all that extra garbage goes a huge way toward keeping those…
If you read this article and thought Hyperscript might be something you wanted to try, please check out Mithril[0].
It's an excellent project, pretty decently fast (checkout the js-framework-benchmark[1] code, or more specifically the results of round 8[2]) -- but is currently suffering from a lack of recognition. It's the kind of project that absolutely doesn't care about that kind of metric (as in, the team seems to be more focused on slow, steady improvement of the library rather than chasing stars on github), but I figured I should say something.
Shameless plug: I recently really wanted to contribute something (and kick the tires more) so I wrote an article that goes through replicating a simple mail design I saw[3] -- it might be a decent overview of what mithril is like to write (though I'm certainly not a mithril expert).
This brings me back to the point at hand -- as others have noted, in my opinion one of the best things about hyperscript is the straight-forwardness with which you construct the render function. I'm not convinced it's necessary to segregate stateless/stateful components -- and mithril is simpler in that it doesn't introduce this dichotomy -- in the end there's the render function, and that's it. If you want to use state, go ahead -- if you don't, then don't. It's the simplicity I've wanted from component frameworks (and mostly get with Vue) without any of the posturing/looming complexity.
Also there's the fact that you could write a completely…
I'd like to discuss the following comparison in: https://vuejs.org/guide/comparison.html#Angular-2
> Vue 2.0 seems to be ahead of Angular 2 according to this 3rd party benchmark. ( http://stefankrause.net/js-frameworks-benchmark4/webdriver-ts/table.html )
The latest benchmark provided is actually:
https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts/table.html
But, Angular 2 is v2.1.1 now, released 2016-10-20. Someone should update: https://github.com/krausest/js-framework-benchmark
However, as they say, "In terms of performance, both frameworks are exceptionally fast and there isn’t enough data from real world use cases to make a verdict."
And Angular 2 Hello World is easier than they make it seem in the comparison:
> starts out with an app that uses ES2015 JavaScript, NPM with 18 dependencies, 4 files, and over 3,000 words to explain it all - just to say Hello World.
It's just the following with a lot of documentation that could be simplified:
mkdir angular-quickstart
(add package.json)
npm install
mkdir app
(add app.component.js)
(add app/app.module.js)
(add app/main.js)
cd ..
(add index.html)
(add styles.css - optional step)
npm start
Also, it makes the case that Angular2 is "enterprise" because many use TypeScript with it. But, TypeScript is optional in both Vue and Angular2, so people could just as easily make the argument that Vue is "enterprise" because it supports TypeScript.
Finally, it's true that Google…
Link to the blog post explaining the table:
http://www.stefankrause.net/wp/?p=301
I've worked on a few apps that feature large tables like this benchmark does. With Angular for example, it's a really bad idea for performance to create DOM elements for each table row when most aren't even visible which I think is done in the benchmark:
https://github.com/krausest/js-framework-benchmark/blob/master/angular-v1.5.7/index.html
There's lots of grid/table libraries available that use what's called virtualisation to stop lots of rows slowing the app down; rows that aren't on the screen aren't computed or rendered.
My feeling is if you avoid rendering data excessively in this way the performance differences between most frameworks aren't that important. If you're required to display 1000s of dynamic values at a time your UI probably needs work.
Hotspot among with other JVMs are no doubt fast -- but partially that came from Java being a static and compiled language.
Not saying that JavaScript is faster, but JavaScript is fast. If you look at the benchmarks I posted, you'll notice that 50% slower is hardly the norm -- many benchmarks have the VMs performing at a near-native performance, and the VMs are even faster in some cases.
In fact, number crunching in JavaScript has been fast for a long time, and even faster than Java in some cases: http://www.stefankrause.net/wp/?p=144
I'm not trying to advocate JavaScript's performance in anyway however. I'm merely pointing out the fact that performance cannot be single-handedly described as "fast" or "slow", especially "for sure". Context matters. A lot.
I don't agree at all. The JVM gets much much better performance than that, and it runs on a runtime that supports ~all platforms. Idiomatic Java and C code will be within ~25% of each other. [1]
Being 4x slower is pretty abysmal, honestly. I would expect a small penalty for running the JIT, but after that the jitted WASM code and native code should be identical. If the hype is to be believed, the jitted code should actually be better than native code.
Maybe running the JIT is just really slow? If the native program ran for a minute, would the WASM version run in 4 minutes, or 1.15 minutes?
[1] https://www.stefankrause.net/wp/?p=4