react icon indicating copy to clipboard operation
react copied to clipboard

Perf freezes browser

Open kikemx78 opened this issue 9 years ago • 5 comments

Banging our heads diagnosing a really bad performance (Firefox specific, Chrome works fine) on a React (^15.3.1) -Redux (^3.5.2) web app updating many objects at the same time. Using node, webpack, Typescript. react-addons-perf (^15.3.1) type definitions from DefinitelyTyped

import { Perf } from 'react-addons-perf' outputs Module '"react-addons-perf"' has no exported member 'Perf'.

import * as Perf from 'react-addons-perf' lets us use Perf.start() on console, but once that command is entered browser freezes.

Any clue of what could be wrong? Help really appreciated.

kikemx78 avatar Jan 19 '17 17:01 kikemx78

@kikemx78 can you provide a repo that demonstrates the issue? Unfortunately, it's going to be near impossible to diagnose if this is a React issue or not without a minimal test case.

import * as Perf from 'react-addons-perf' lets us use Perf.start() on console, but once that command is entered browser freezes.

Check out the docs page on Perf which has instructions on how to import it.

aweary avatar Jan 19 '17 17:01 aweary

Hi @aweary, I made a test repo under an existing template. Shows the same Module '"react-addons-perf"' has no exported member 'Perf'.

https://github.com/kikemx78/react-perf-test

kikemx78 avatar Jan 19 '17 17:01 kikemx78

Do you see the same problem in Firefox? We had similar issues - things worked superbly in Chrome but lagged in Firefox and IE - but we were doing a lot of virtualization - building a react datagrid component http://reactdatagrid.com

What we found really helpful was the chrome and IE inspector - specifically the "ui responsiveness" tab - look at what is running per frame - helps you narrow it down. As a general note though, IE and FF lag Chrome in terms of updating DOM attributes of numerous dom components per frame (hundreds) (which is what React is doing internally anyway)

flexicious avatar Jan 23 '17 18:01 flexicious

@flexicious you talk about React.Perf on Firefox? If it's the case, the answer is yes. We can't run the Perf tool (Chrome, Firefox) because of import { Perf } from 'react-addons-perf' outputs Module '"react-addons-perf"' has no exported member 'Perf'.

In general, we do have a really bad performance on Firefox and IE (not Edge, that seems ok) when handling many items. Our app handles data from sports betting so we have lots of DOM updates/sec. We have narrowed down the issue - a reducer being called over and over with no state updates - but would be amazing to be able to set up React Perf tools.

kikemx78 avatar Jan 23 '17 18:01 kikemx78

Perf addon doesn't work in React 16 anyway so we can close it.

gaearon avatar Oct 04 '17 16:10 gaearon