question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Devtools perf issue with 16.7.0

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior? When using a component that creates new Date objects inside an interval while having the Devtools extension open, the performance are really slow.

With React 16.4.1, I don’t have the same issue so it might be related to the Profiler tab (even if it also happen when being on the Elements tab).

Reproduction: 16.7.0 version with performance issues: https://codesandbox.io/s/w6zrvx1y98 16.4.1 version without perf issues: https://codesandbox.io/s/4x4jmx8zx4

Open the devtools on the standalone page (https://w6zrvx1y98.codesandbox.io) while watching the Chrome task manager and you will see the memory go up quickly and the CPU be higher than 100%.

You might want to adjust the ARRAY_SIZE and INTERVAL constants based on your computer performance.

What is the expected behavior? The page should not slow down that much. In my app, I display a list of 30 lines where each of them contains this component and the refresh rate is one second (the time change there). There was no issue at all with React 16.4.1 (I actually didn’t know that this component existed 😄).

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? 16.7.0 is affected while 16.4.1. I also had the same issue with 16.6.0 and I thought it was related to #14365 but it is actually a different one.

[EDIT]: it’s not a Chrome issue because I could reproduce the same issue on Firefox.

By the way, I’d be happy to make a PR for this if this makes sense. 🙂

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ValentinHcommented, Feb 9, 2019

I’ve just profile the example I’ve shared above and here are the results:

With React 16.4.1

image

With React 16.7.0 (same with 16.8.1)

image

As you can see, with 16.7, there is some big chunks of function calls in the devtools extension, especially this one: image

I’m installing the development version of Devtools so I can better understand what this function is doing.

1reaction
gaearoncommented, Feb 8, 2019

I mean that while slowdown may be caused by the profiler mode (which is enabled when devtools is detected) it may still happen inside React. Look at https://github.com/facebook/react/issues/14365 for an example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-devtools | Yarn - Package Manager
react -devtools. This package can be used to debug non-browser-based React applications (e.g. React Native, mobile browser or embedded webview, Safari).
Read more >
Tackling performance issues in ReactDataGrid · React Data Grid
One of the best tools for measuring performance and identifying perf issues is the Performance tab of the Chrome dev tools. Note: since...
Read more >
Introducing the React Profiler – React Blog
The DevTools profiler groups performance info by commit. Commits are displayed in a bar chart near the top of the profiler:.
Read more >
Debugging performance problems in React - LogRocket Blog
Once the application we're using is created with this setting on, you don't have to worry about it. Now, open your Chrome DevTools...
Read more >
ReactJS Version - javatpoint
SN Version Release Date 1. 0.3.0 29/05/2013 2. 0.4.0 20/07/2013 3. 0.5.0 20/10/2013
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found