Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] New ReactDefaultPerf #962

Closed
wants to merge 1 commit into from
Closed

Conversation

petehunt
Copy link
Contributor

This isn't the best code I ever wrote but it's better than what's there. This rewrites ReactDefaultPerf to be actionable and is structured so we can integrate it into the devtools later. Still needs more testing but putting this out for initial feedback.

I did a video demo here: http://www.youtube.com/watch?v=Xc53eUYDt6I&feature=youtu.be

We could strip out the measure() calls with a build step similar to invariant() if we want to get rid of the size increase:

   raw     gz Compared to last run
     =      = build/JSXTransformer-previous.js
     =      = build/JSXTransformer.js
     =      = build/react-previous.min.js
     =      = build/react-test.js
 -4415  -1208 build/react-with-addons.js
  +606   +122 build/react-with-addons.min.js
-13478  -3216 build/react.js
  +606   +123 build/react.min.js

// For each component that rendered, see if a component that triggerd
// a DOM op is in its subtree.
for (var i = 0; i < dirtyLeafIDs.length; i++) {
if (dirtyLeafIDs[i].indexOf(id) === 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is buggy. IDs won't work here. I'll need to come up with something that follows the owner hierarchy.

petehunt added a commit that referenced this pull request Feb 12, 2014
petehunt added a commit that referenced this pull request Feb 12, 2014
Simplified version of #962. More goodies coming soon since the inclusive time isn't very helpful right now.
@petehunt
Copy link
Contributor Author

it's in

@petehunt petehunt closed this Feb 13, 2014
@syranide
Copy link
Contributor

Cool!

toptaldev92 pushed a commit to toptaldev92/react_project that referenced this pull request Jul 28, 2021
toptaldev92 pushed a commit to toptaldev92/react_project that referenced this pull request Jul 28, 2021
Simplified version of facebook/react#962. More goodies coming soon since the inclusive time isn't very helpful right now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants