8 ms·
I believe it's referencing this: https://github.com/KonnorRogers/view-layer-benchmarks https://github.com/KonnorRogers/view-layer-benchmarks
by fidrelity 1y ago
I believe it's referencing this: https://github.com/KonnorRogers/view-layer-benchmarks https://github.com/KonnorRogers/view-layer-benchmarks
- byroot 1y agoCan't believe this still has to be debunked. No Phlex certainly isn't 12x faster than ERB. It's noticeably slower than ERB, e.g.: https://github.com/KonnorRogers/view-layer-benchmarks/commit/80a3ffd90d5d08b0361a875dfd7d01517476039a https://github.com/KonnorRogers/view-layer-benchmarks/commit... In some extreme scenarios with tons of very small partials, it can win against Action View because the Action View partial lookup is significant overhead.
- tenderlove 1y agoIt says on the website it's 12x faster so it must be true! https://rubyui.com https://rubyui.com
- joeldrapper 1y agoIt probably is (or at least was) faster than ActionView if you use lots of small partials, but it is not faster than ERB since it is not compiled. It generates HTML at about 1.6gbps per core on my laptop so probably fast enough for most things.
- joeldrapper 1y agoIn my experience, it’s not an extreme scenario to render several thousand components in a single view. I think you’re looking at this from the perspective of having maybe a partial for your header and another for your footer. The way you build views in Phlex is you would have a component not just for the header but also the nav, each item in the nav, and each icon in each item. We can argue about whether that level of abstraction and reuse is worth it, but the fact is ActionView gets very slow when you build views like that composing thousands of partials — and for people who want to build views like that, it matters. Still, I think these “12× faster” comparisons are silly. If ActionView was just as fast at rendering thousands of small components, I’d still pick Phlex for the developer experience. I enjoy writing Ruby, not toggling between Ruby and HTML.
- mrinterweb 1y agoThere were a few things off about the benchmarks so I made a pull request with some updates. The 12x claim is WAY off. https://github.com/KonnorRogers/view-layer-benchmarks/pull/22 https://github.com/KonnorRogers/view-layer-benchmarks/pull/2...