React-native: Failed to execute 'measure' on 'WorkerPerformance': The mark '757::componentWillMount' does not exist

Created on 12 Dec 2016  路  3Comments  路  Source: facebook/react-native

Description

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.

Reproduction

Simply import the perf addon as in import Perf from 'react-native/Libraries/Renderer/src/renderers/shared/ReactPerf'; and then run Perf.start().

Solution

Ideally, Perf.start(), Perf.stop(), etc would work as advertised. It's very difficult to investigate rendering issues without it for more complex scenes.

Additional Information

  • React Native version: 0.39.1
  • Platform: Both
  • Operating System: MacOS
Locked

Most helpful comment

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

josev55 picture josev55  路  3Comments

grabbou picture grabbou  路  3Comments

axelg12 picture axelg12  路  3Comments

despairblue picture despairblue  路  3Comments

WG-Com picture WG-Com  路  3Comments