Packages

  • package root
    Definition Classes
    root
  • package japgolly
    Definition Classes
    root
  • package scalajs
    Definition Classes
    japgolly
  • package react
    Definition Classes
    scalajs
  • package feature
    Definition Classes
    react
  • object Profiler

    The Profiler measures how often a React application renders and what the "cost" of rendering is.

    The Profiler measures how often a React application renders and what the "cost" of rendering is. Its purpose is to help identify parts of an application that are slow and may benefit from optimizations such as memoization.

    See https://reactjs.org/docs/profiler.html

    Definition Classes
    feature
    Since

    React 16.9.0 / scalajs-react 1.7.0

  • Interaction
  • OnRenderData

final case class OnRenderData(id: String, phase: String, actualDurationMs: Double, baseDurationMs: Double, startTime: Double, commitTime: Double, rawInteractions: Iterable[facade.Interaction]) extends Product with Serializable

Data returned by the Profiler.

id

The id prop of the Profiler tree that has just committed. This can be used to identify which part of the tree was committed if you are using multiple profilers.

phase

Identifies whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or hooks.

actualDurationMs

Time spent rendering the Profiler and its descendants for the current update. This indicates how well the subtree makes use of memoization (e.g. React.memo, useMemo, shouldComponentUpdate). Ideally this value should decrease significantly after the initial mount as many of the descendants will only need to re-render if their specific props change.

baseDurationMs

Duration of the most recent render time for each individual component within the Profiler tree. This value estimates a worst-case cost of rendering (e.g. the initial mount or a tree with no memoization).

startTime

Timestamp when React began rendering the current update.

commitTime

Timestamp when React committed the current update. This value is shared between all profilers in a commit, enabling them to be grouped if desirable.

Annotations
@nowarn()
Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OnRenderData
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new OnRenderData(id: String, phase: String, actualDurationMs: Double, baseDurationMs: Double, startTime: Double, commitTime: Double, rawInteractions: Iterable[facade.Interaction])

    id

    The id prop of the Profiler tree that has just committed. This can be used to identify which part of the tree was committed if you are using multiple profilers.

    phase

    Identifies whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or hooks.

    actualDurationMs

    Time spent rendering the Profiler and its descendants for the current update. This indicates how well the subtree makes use of memoization (e.g. React.memo, useMemo, shouldComponentUpdate). Ideally this value should decrease significantly after the initial mount as many of the descendants will only need to re-render if their specific props change.

    baseDurationMs

    Duration of the most recent render time for each individual component within the Profiler tree. This value estimates a worst-case cost of rendering (e.g. the initial mount or a tree with no memoization).

    startTime

    Timestamp when React began rendering the current update.

    commitTime

    Timestamp when React committed the current update. This value is shared between all profilers in a commit, enabling them to be grouped if desirable.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. lazy val actualDuration: Duration

    Time spent rendering the Profiler and its descendants for the current update.

    Time spent rendering the Profiler and its descendants for the current update. This indicates how well the subtree makes use of memoization (e.g. React.memo, useMemo, shouldComponentUpdate). Ideally this value should decrease significantly after the initial mount as many of the descendants will only need to re-render if their specific props change.

  5. val actualDurationMs: Double
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. lazy val baseDuration: Duration

    Duration of the most recent render time for each individual component within the Profiler tree.

    Duration of the most recent render time for each individual component within the Profiler tree. This value estimates a worst-case cost of rendering (e.g. the initial mount or a tree with no memoization).

  8. val baseDurationMs: Double
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. val commitTime: Double
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. val id: String
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. val phase: String
  20. def phaseIsMount: Boolean
  21. def phaseIsUpdate: Boolean
  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. val startTime: Double
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. lazy val interactions: Vector[Interaction]

    Set of "interactions" that were being traced when the update was scheduled (e.g.

    Set of "interactions" that were being traced when the update was scheduled (e.g. when render or setState were called).

    Annotations
    @deprecated
    Deprecated

    (Since version 2.2.0) Removed in React 18

  2. val rawInteractions: Iterable[facade.Interaction]
    Annotations
    @deprecated
    Deprecated

    (Since version 2.2.0) Removed in React 18

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped