-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Perf.printWasted prints newly inserted dom nodes in list as a waste of time #1931
Comments
Probably @joshduck. :) |
Oops, sorry Josh! If you want to send some GH staff over to help debug though… |
Yes I've seen something like that too @spicyj ! but for my real app it seems to print the table constantly. |
Running into same issue here #2105 |
👍 having the same issue! |
I suppose it's because component.setProps({state: state}, function() {
React.addons.Perf.stop();
React.addons.Perf.printWasted();
}); The fixed fiddles are below. Unfortunately, |
Was this ever resolved? React.addons.Perf is still behaving similarly with newly inserted dom nodes being printed as wasted time. Also, @koba04 could I get some clarity on why the first fiddle prints wasted time but the second does not? |
No this is not resolved as of 0.13 and I don't think either in 0.14 |
We haven't had a chance to look, no. Improving perf tooling is on our goals for 2015 but it won't happen before 0.14. |
@jaehunro But I can't understand the second fiddle prints wasted time sometimes... |
Thank you so much for the quick responses! I took a look through the source code to gain some understanding on how However, newly inserted DOM nodes were being counted as clean because Is my thinking on the right track or misguided? |
Fixed by #4683. |
First of all, during my attempt to show you this bug, I found this weird behavior:
I don't know why one does show wasted time and not the other
On 2) I use shouldComponentUpdate=true, and we can see the time waste grows with the list size as well as the number of instances in the table.
So finally, to demonstrate my problem, see http://jsfiddle.net/kb3gN/4094/
I've implemented correctly shouldComponentUpdate and now each time I add a new element in the list, it is considered as a waste of time. My table always show 1 instance: the one that just got inserted.
I've had this problem on my app, when dealing with a paginated list (loading more items from the server as the user scrolls down). I don't think this newly inserted node should be printed in
printWasted
The text was updated successfully, but these errors were encountered: