Skip to content

Perf.printWasted prints newly inserted dom nodes in list as a waste of time #1931

Closed
@slorber

Description

First of all, during my attempt to show you this bug, I found this weird behavior:

  1. http://jsfiddle.net/kb3gN/4092/ does not show any time wasted (on user click action)
  2. http://jsfiddle.net/kb3gN/4093/ does
    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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions