Live data from Hacker News

Ask HN: How to performance test React webapps for rendering speed regressions?

news.ycombinator.com

11–20 of 24 posts

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#11

For frontend performance: record the frame rate (via requestAnimationFrame, look at simple frame rate counters), memory, count of DOM nodes on the page during each of your integration tests as a good start. You can get a lot of this via window.performance and memory info you need to pass an extra flag into chrome headless. It’s also useful to instrument this in your production environment (called real user metrics) f…

Thanks a lot, this is something I was specifically looking for!

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#12
post #5

At Asana, we actually test performance in production with a A/B test split. We use Interana (but any data aggregator would work) to analyze the results. Trying to measure the regressions in a sandbox did not match our Real User Metrics (RUM). In order for this to work though, you need to develop a strong mental model of React performance so you can optimize it further.

Do you have a blog post or something like that about React performance or the mental model you got? It would be an interesting read.

This is probably the best one we have in public https://blog.asana.com/2017/08/performance-asana-app-rewrite.... If you have specific questions, we would be happy to write a follow up one! A lot of the work we've done has been measuring time from request to finished render.

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#13
post #8
post #6

I don't do front end, but I asked my team and they linked me to: https://medium.com/@paularmstrong/twitter-lite-and-high-perf... https://github.com/markerikson/react-redux-links/blob/master... Might be worth going through. Hopefully they're useful.

Hey, that's my links list! :) Hope that's helpful! While it's probably not 100% relevant, you might also want to glance at some of the things I've done trying to benchmark performance for the React-Redux library itself, including running benchmarks in Puppeteer and capturing metrics like render times and FPS [0]. Now, my experience has been that I have to deliberately crank up the number of components on screen and d…

Amazing list! Thanks! Just pinged you on Twitter too. I'll add a note here for anyone interested that I've been looking at performance testing as part of our functional/regression testing strategy. Haven't used it yet, but this Jest library with puppeteer looks promising: https://github.com/jj4th/jest-puppeteer-performance

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#14

For frontend performance: record the frame rate (via requestAnimationFrame, look at simple frame rate counters), memory, count of DOM nodes on the page during each of your integration tests as a good start. You can get a lot of this via window.performance and memory info you need to pass an extra flag into chrome headless. It’s also useful to instrument this in your production environment (called real user metrics) f…

+1 on instrumenting production. Best way to find out regressions, and future optimizations.

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#15
> As React webapps get large and start to contain a lot of complex components, they often do not perform well and manifest low FPS in browser.

Is this something you have actually experienced? Can you cite an example of running into this issue? I've built fairly complex UIs with React (tables with nested dropdowns, financial statements with a lot of data points, dynamic charts / graphs, elements with animations, etc. and haven't run into this issue.

The only time I've seen people have trouble w/ performance is when they use something like Redux or Apollo on top of React. The problem in those cases of course is Redux or Apollo, not React itself.

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#16
Before you spend time profiling a performance issue, make sure you're using the production build of React. The development build is significantly slower. It sounds obvious, but I've made the mistake of trying to optimize performance issues that simply didn't exist in production.

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#17
post #8
post #6

I don't do front end, but I asked my team and they linked me to: https://medium.com/@paularmstrong/twitter-lite-and-high-perf... https://github.com/markerikson/react-redux-links/blob/master... Might be worth going through. Hopefully they're useful.

Hey, that's my links list! :) Hope that's helpful! While it's probably not 100% relevant, you might also want to glance at some of the things I've done trying to benchmark performance for the React-Redux library itself, including running benchmarks in Puppeteer and capturing metrics like render times and FPS [0]. Now, my experience has been that I have to deliberately crank up the number of components on screen and d…

Even better these days, just use the profiler in Chrome. It’ll show you which components are mounting and rendering. I find that I can isolate troublesome components at a glance now.

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#18

For frontend performance: record the frame rate (via requestAnimationFrame, look at simple frame rate counters), memory, count of DOM nodes on the page during each of your integration tests as a good start. You can get a lot of this via window.performance and memory info you need to pass an extra flag into chrome headless. It’s also useful to instrument this in your production environment (called real user metrics) f…

Don't mind the downvotes. Thank you for taking the time to post such an insightful post.

Re: Ask HN: How to performance test React webapps for rendering speed regressions?

#20
WebdriverIO recently got support for Lighthouse, but also the devTools plungin has support for page load.

If I were to set this up I'd use devtools to throttle the network down to 3g, and I would actually render the browser in the test.

https://github.com/webdriverio/webdriverio/tree/master/packa...

Post reply on HN