-
Notifications
You must be signed in to change notification settings - Fork 558
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
Profiler should measure commit phase durations #139
Conversation
Should this RFC drop passive effect timing?As I dig into actually implementing this, I've realized there are a few challenges presented by passive effects. The biggest is that we can't call
I think this means that we would need to do the following:
Adding a new DevTools hook is probably fine. I'm less sure about adding the extra traversal passes. (Do passive effect durations actually provide enough value to offset this?) I'll go ahead and do it for now, but I assume we may want to re-evaluate the cost/benefit during the PR stage. |
Should we measure cleanup functions?This is tricky in a similar way as passive effects, since cleanup functions don't get run until an update (or unmount)- after we've already reported durations. We have a couple of options here. I'm going to list them from least ideal to most ideal:
My current vote is for option 4 above (include their durations as part of the current commit). Should we also measure "before mutation" code?Currently this only includes the class component Given the currently proposed callbacks ( I am currently thinking that it might be better to track this with a separate RFC. Pre-mutation effects aren't very common, so it seems a little less urgent. |
I've updated the RFC to incorporate the above comments. |
Implementation PR has been accepted and merged, so I'm going to merge the RFC. |
View formatted RFC
Implementation: facebook/react#17910