I am trying to use the ReactPerf tool in order to analyze DOM rendering performance and running to the following exception:
Failed to execute 'measure' on 'WorkerPerformance': The mark '757::componentWillMount' does not exist
The number 757 is variable.
Simply import the perf addon as in import Perf from 'react-native/Libraries/Renderer/src/renderers/shared/ReactPerf'; and then run Perf.start().
Ideally, Perf.start(), Perf.stop(), etc would work as advertised. It's very difficult to investigate rendering issues without it for more complex scenes.
Same on RN 0.38.0
If you do something like this. It will work.
componentDidMount() {
setTimeout(() => {
Perf.start();
setTimeout(() => {
Perf.stop();
const measurements = Perf.getLastMeasurements();
Perf.printWasted(measurements);
}, 30000);
}, 5000);
}
Or just call
Perf.start() outside the class.
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.
Most helpful comment
If you do something like this. It will work.
Or just call
Perf.start() outside the class.