Skip to content

Change how ReactPerf.printWasted() and ReactPerf.printOperations() work #6632

@gaearon

Description

@gaearon

#6046 is a rewrite of ReactPerf that aims to provide the existing features of ReactPerf in a more testable and future-proof way. However there are a few things that are out of scope of #6046 but are important to fix later after it is shipped.

Today, printOperations() prints informations about the DOM “native” events that supposedly happened. Later, this information is used by printWasted() in the following way: if a component was rendered but no DOM events on its children were emitted during a batch, the render is considered wasted.

There are a few problems with this:

I don’t know what would be a good solution considering these constraints. People widely consider printWasted() the most useful ReactPerf method because it helps finding shouldComponentUpdate() sweet spots. If we remove its reliance on DOM, we should offer an equivalent (e.g. deeply comparing React elements?) that is just as useful but more friendly to incremental reconciliation.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions