Can reagent
be faster than React
?
@eliraz.kedmi157 There is some overhead on runtime Hiccup vectors etc. to React element conversion, but in application level immutable values (faster identity check for changed properties) and ratom/re-frame architecture can work to enable Reagent to call render less often and to move costly operations outside of render calls. Though well written React app could use the same optimizations.
https://krausest.github.io/js-framework-benchmark/current.html
This is very naive benchmark, just pure render performance.
yes. it also didn't take the latest reagent
version, nor the functional-compiler
feature.
there probably isn't much difference with latest version, and my very basic testing showed that functional compiler doesn't really affect performance
well, even on react's side moving to the functional (hooks) side didn't do much change in performance in idiomatic testings, however, working with hooks encourage you to utilize more DRY, thus making your app faster due to a better programming and not pure performance of the framework / library
I was hoping to see that reflects at those benchmarks you showed .
Managing state with hooks works quite similar to what Reagent atoms/reactions and such already do.
Btw. Reagent select-row implementation for that js-framework-benchmark was badly written, after fix it will probably match React.
oh good to know
what is router is recommended with reagent
?
Reitit
thank you, I was just looking at it
Local benchmark run on my laptop with select-row optimization and function component version comparison. There is a bit more overhead on function components.
Select row is now even faster than React 🙂