S

Stefan Krause

stefankrause.net · Personal blog · on HN since 2011

Stefan Krause, a developer, publishes benchmarks comparing the performance of JavaScript frameworks, and has also looked at WebAssembly and the JVM.

What HN saysHN 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.
43HN people shared it
27linked it in comments
25stories submitted
349story points
4 years agolast shared
2011people per year2026

Most-shared posts

  1. 1
    JS web frameworks benchmark – Round 4
    5 people · 7 points · first shared 2016 · discussion on HN
  2. 2
    JS web frameworks benchmark – Round 6
    5 people · 6 points · first shared 2017 · discussion on HN
  3. 3
    JavaScript Web Frameworks Benchmark – Round 8
    5 people · 1 points · first shared 2018 · discussion on HN
  4. 4
    JS web frameworks benchmark – Round 3
    4 people · 2 points · first shared 2016 · 1 comments on HN
  5. 5
    JS web frameworks benchmark – Round 5
    3 people · 6 points · first shared 2017 · 1 comments on HN
  6. 6
    JS web frameworks benchmark – Round 8
    3 people · 4 points · first shared 2018 · 1 comments on HN
  7. 7
  8. 8
    Round 4 of JavaScript frameworks benchmarks
    3 people · 1 points · first shared 2016 · discussion on HN
  9. 9
  10. 10
    Table
    3 people · first shared 2017
  11. 11
    A first look at WebAssembly performance
    2 people · 170 points · first shared 2017 · 125 comments on HN
  12. 12
    JS web frameworks benchmark – Round 7
    2 people · 23 points · first shared 2017 · 6 comments on HN
  13. 13
    JDK 7 GC behavior
    2 people · 10 points · first shared 2011 · discussion on HN
  14. 14
    Wp
    2 people · first shared 2013
  15. 15
    Performance Comparison of JavaScript Frameworks
    1 people · 112 points · first shared 2016 · 54 comments on HN

What HN people wrote when they linked it

rich_harris · 2017-09-11
According to js-framework-benchmark (http://www.stefankrause.net/wp/?p=431) it doesn't just use much less memory than React, it uses less memory than any other framework, because we don't have the overhead of a virtual DOM. And yes, it's significantly faster. I answered the deduplication point in another reply to the parent, but you make a great point about code-splitting. If you're using a convention runtime framework it doesn't matter how aggressively you code-split — your smallest chunk will be at least as large as your framework. Self-contained components solve that problem.
ianopolous · 2016-02-03
I'd like to see evidence for this. the JVM has been great at stack allocation for over a decade [1][2]. [1] http://www.stefankrause.net/wp/?p=64 [2] http://www.ibm.com/developerworks/library/j-jtp09275/
hardwaresofton · 2019-02-25
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…
haalcion3 · 2016-10-21
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.ht… ) The latest benchmark provided is actually: https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts… 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…
dahfizz · 2022-12-08
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
stevenhuang · 2021-03-25
Nothing beats vanilla JS in terms of DOM manipulation speed. https://stefankrause.net/js-frameworks-benchmark8/table.html And Svelte is fast. It's as fast or faster than React in most synthetic benchmarks. For how and why, see https://svelte.dev/blog/virtual-dom-is-pure-overhead (notably the intelligent compilation step which removes need for vdom)
dsissitka · 2019-12-19
> 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.html
ergo14 · 2018-10-17
https://stefankrause.net/js-frameworks-benchmark8/table.html - thats old lit release there vs react 16 (react pre 16 would be slower and everyone agrees its generally fast already), on slack channel I believe I saw newer release benchmarks that are better (it also depends at which specific test you look at). New version of repeat is interesting: https://slack-files.com/T03PF4L4C-FCY51FZAB-c2fcf32931
yzmtf2008 · 2018-02-09
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.
curveship · 2017-09-11
Just throwing my side project, Surplus, out there as another example of this strategy (https://github.com/adamhaile/surplus). Surplus compiles JSX into optimized code that produces real DOM elements. The combination of an ahead-of-time compiler plus no virtual DOM layer means that the runtime code only has to do the minimal, truly dynamic work. As a result, Surplus is the fastest framework in Stefan Krauss's latest js-framework-benchmark (http://www.stefankrause.net/wp/?p=431). DSLs are powerful, compiler support can make them fast.
daliwali · 2017-07-04
You literally said, "complexity is not my problem". You are the problem. This is how projects end up with millions of lines of black box dependencies. This is why `node_modules` folders that are hundreds of megabytes exist. Take a look at benchmarks [0] and tell me, if any framework performs faster than vanilla JS. They probably are faster than vanilla code that you'd be able to write on your own, but that says more about your abilities than the performance of frameworks. [0] http://www.stefankrause.net/js-frameworks-benchmark6/webdriver-ts-resu…
roucoulawan · 2017-06-25
So maybe do we have somewhere some cool benchmarks to compare with the others frameworks ? Like here http://www.stefankrause.net/js-frameworks-benchmark5/webdriver-ts/tabl…
nawfalhasan · 2017-04-15
http://www.stefankrause.net/js-frameworks-benchmark5/webdriver-ts/tabl… Performance perhaps slightly lower than React though.
KayL · 2017-02-05
Having no experiences with it. The author calmed that is faster but the benchmark result in below chart was shown different word: http://www.stefankrause.net/js-frameworks-benchmark5/webdriver-ts/tabl…
greenspot · 2017-01-13
Is it faster than Inferno[1]? [1] Inferno seems to be the fastest React drop-in replacement at 9kb size at the moment: http://stefankrause.net/js-frameworks-benchmark4/webdriver-ts/table.ht… - full post to the comparison table before: http://www.stefankrause.net/wp/?p=316
sjnsjn · 2016-10-21
It (v2) is quite fast too http://www.stefankrause.net/wp/?p=316
adamnemecek · 2016-07-13
There has also been some perf work done recently it seems http://www.stefankrause.net/wp/?p=301 I have to look a little closer at the tests to be able to interpret the data but taking it on face value it seems like they are doing good work.
venning · 2016-07-10
This might be a better link, which includes a brief write-up of the work: http://www.stefankrause.net/wp/?p=301
seanwilson · 2016-07-10
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… 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.
thecrazyone · 2016-02-04
You're missing the point he's making. Preact is leaner than react. FF was leaner than mozilla. React isn't slow (yet?), but it's not hitting any universal limits, there's always scope for leaner, smaller and faster software (yes it is, see benchmark). benchmark: http://www.stefankrause.net/wp/?p=283 Edit: Added some reference benchmarks.
codeisawesome · 2016-02-03
Here's an answer I found: Vidom (https://github.com/dfilatov/vidom) It's faster than React or Angular 2 in one benchmark methodology: http://www.stefankrause.net/wp/?p=218
pron · 2013-10-02
Java value-types (+ arrays) are in the works. The JVM already does what is known as "scalar replacement" (http://www.stefankrause.net/wp/?p=64) automatically allocating some non-escaping objects on the stack.
thangalin · 2013-01-09
http://www.stefankrause.net/wp/?p=4 "Saying that C is generally several times faster than java is – according to those benchmarks – simply wrong. In other benchmarks Sun and JRockit were even able to beat ICC. Not by much but I guess it’s nevertheless just very remarkable that it’s possible to beat ICC [using a Java Virtual Machine]."
hajile · 2019-12-19
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…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close