Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to measure app performance with react rails? #773

Closed
1 of 4 tasks
anaumov opened this issue Aug 23, 2017 · 3 comments
Closed
1 of 4 tasks

How to measure app performance with react rails? #773

anaumov opened this issue Aug 23, 2017 · 3 comments
Assignees

Comments

@anaumov
Copy link

anaumov commented Aug 23, 2017

Help us help you! Please choose one:

  • My app crashes with react-rails, so I've included the stack trace and the exact steps which make it crash.
  • My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.
  • I'm trying to use react-rails with another library, but I'm having trouble. I've described my JavaScript management setup (eg, Sprockets, Webpack...), how I'm trying to use this other library, and why it's not working.
  • I have another issue to discuss.

First of all thanks for awesome gem! My question is in title. How can I use react performance tools? https://facebook.github.io/react/docs/perf.html

Do react-rails have any hooks to insert Perf.start() and Perf.stop() to see stats for components rendered via react_component helper.

@rmosolgo
Copy link
Member

No, react-rails doesn't have anything built-in to support this. But you can see the hooks it uses for setup and teardown in the react_ujs:

https://github.com/reactjs/react-rails/tree/master/react_ujs/src/events

So, perhaps you could add hooks to those same triggers to start and stop Perf?

@BookOfGreg
Copy link
Member

BookOfGreg commented Nov 3, 2017

From https://reactjs.org/docs/perf.html

As of React 16, react-addons-perf is not supported. Please use your browser’s profiling tools to get insight into which components re-render.

Seems as though measuring in the browser is probably the best way of knowing the true performance of your app.

There are still a variety of small benchmarks available such as wrapping the view-helper in a call to benchmark

Will add perf testing to the Wiki. Thanks!

@BookOfGreg BookOfGreg self-assigned this Nov 3, 2017
@BookOfGreg
Copy link
Member

@anaumov New Wiki page detailing performance! 🎉

https://github.com/reactjs/react-rails/wiki/Performance

If you have any other thoughts please let me know. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants