Fork me on GitHub
#reagent
<
2020-05-19
>
Eliraz09:05:12

Can reagent be faster than React ?

juhoteperi09:05:21

@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.

juhoteperi09:05:49

This is very naive benchmark, just pure render performance.

Eliraz09:05:44

yes. it also didn't take the latest reagent version, nor the functional-compiler feature.

juhoteperi09:05:36

there probably isn't much difference with latest version, and my very basic testing showed that functional compiler doesn't really affect performance

Eliraz09:05:58

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

Eliraz09:05:50

I was hoping to see that reflects at those benchmarks you showed .

juhoteperi10:05:12

Managing state with hooks works quite similar to what Reagent atoms/reactions and such already do.

juhoteperi10:05:49

Btw. Reagent select-row implementation for that js-framework-benchmark was badly written, after fix it will probably match React.

Eliraz14:05:38

oh good to know

Eliraz15:05:26

what is router is recommended with reagent ?

Eliraz15:05:23

thank you, I was just looking at it

juhoteperi17:05:16

Local benchmark run on my laptop with select-row optimization and function component version comparison. There is a bit more overhead on function components.

🎉 16
juhoteperi17:05:40

Select row is now even faster than React 🙂