React 16.4 will introduce a new
Profiler component (initially exported as
React.unstable_Profiler) for collecting render timing information in order to measure the "cost" of rendering for both sync and async modes.
Profiler timing metrics are significantly faster than those built around the User Timing API, and as such we plan to provide a production+profiling bundle in the future. (The initial release will only log timing information in DEV mode, although the component will still render its children- without timings- in production mode.)
How is it used?
Profiler can be declared anywhere within a React tree to measure the cost of rendering that portion of the tree. For example, a
Navigation component and its descendants: