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

putListener dominating ReactPerf.printDOM() and printWasted() #5189

Closed
STRML opened this issue Oct 15, 2015 · 19 comments
Closed

putListener dominating ReactPerf.printDOM() and printWasted() #5189

STRML opened this issue Oct 15, 2015 · 19 comments

Comments

@STRML
Copy link
Contributor

STRML commented Oct 15, 2015

I believe this is a Safari hack? I'm seeing putListener get out of control, even for elements that haven't updated (they've rerendered, but no change was necessary to the DOM).

This also is causing weird interactions with react-raf-batching, which we've forked for 0.13 and 0.14. It was working fine in 0.13 but now, fast interactions cause findComponentRoot() errors as it's attempting to run putListener().

Example printDOM() output:

[
  {
    "data-reactid": ".0.0.0.1.$XBT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBU",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$BVOL",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$Recent",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$All",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "update attribute",
    "args": "[\"className\",\"groupSelector selected\"]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "update attribute",
    "args": "[\"className\",\"groupSelector\"]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.1.0.1.4.0.1",
    "type": "update attribute",
    "args": "[\"value\",\"placeholder\"]"
  },
  {
    "data-reactid": ".0.0.0.2",
    "type": "set innerHTML",
    "args": "{\"toIndex\":0,\"markup\":\"<span class=\\\"instrument ZeroPlusTick\\\" data-reactid=\\\".0.0.0.2.$=1XLT\\\"><a href=\\\"/app/index/.XLT\\\" title=\\\".XLT Index\\\" class=\\\"symbol \\\" data-reactid=\\\".0.0.0.2.$=1XLT.0\\\">XLT Spot</a><span class=\\\"price\\\" data-reactid=\\\".0.0.0.2.$=1XLT.1\\\">3.1000</span><span class=\\\"lastChangePcnt neg\\\" title=\\\"Session Change\\\" data-reactid=\\\".0.0.0.2.$=1XLT.2\\\">-1.51%</span></span>\"}"
  },
  {
    "data-reactid": ".0.0.0.2",
    "type": "remove",
    "args": "{\"fromIndex\":0}"
  },
  {
    "data-reactid": ".0.0.0.2",
    "type": "remove",
    "args": "{\"fromIndex\":1}"
  },
  {
    "data-reactid": ".0.0.0",
    "type": "set innerHTML",
    "args": "{\"toIndex\":3,\"markup\":\"<span class=\\\"instrument ZeroPlusTick\\\" data-reactid=\\\".0.0.0.3:$XLT7D\\\"><a href=\\\"/app/trade/XLT7D\\\" title=\\\"Litecoin / US Dollar 16 Oct 2015 (Every Friday) Quanto Futures Contract\\\" class=\\\"symbol \\\" data-reactid=\\\".0.0.0.3:$XLT7D.0\\\">XLT7D</a><span class=\\\"price\\\" data-reactid=\\\".0.0.0.3:$XLT7D.1\\\">3.1116</span><span class=\\\"lastChangePcnt neg\\\" title=\\\"Session Change\\\" data-reactid=\\\".0.0.0.3:$XLT7D.2\\\">-2.16%</span></span>\"}"
  },
  {
    "data-reactid": ".0.0.0",
    "type": "remove",
    "args": "{\"fromIndex\":3}"
  },
  {
    "data-reactid": ".0.0.0.1.$XBT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBU",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$BVOL",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$Recent",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$All",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBU",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$BVOL",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$Recent",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$All",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.4.0.1.$/=10.$bids.1.0.1.$0XBT24H",
    "type": "update attribute",
    "args": "[\"className\",\" bids\"]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.4.0.1.$/=10.$asks.1.0.1.$0XBT24H",
    "type": "update attribute",
    "args": "[\"className\",\" asks\"]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBU",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$BVOL",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$Recent",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$All",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.0.0.0.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.0.0.0.$4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.1.$/=10.1.0.1.$2.$actions.0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.8.0.1.$/=10.1.0.1.$70f36045-67bd-377f-0c9d-b144c58f5c04.$symbol.0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBU",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$BVOL",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$Recent",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$All",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XBU",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$BVOL",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$XLT",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$ETH",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$Recent",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.0.0.1.$All",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.0.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.6.0.1.$/=10.2.1.$Limit/=1$Limit.1.0.1.2.$3",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.a.0.0.0.0.$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$0",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.3.0.0.$=1$/app/trade.1.b.0.0.0.0.$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$1",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  },
  {
    "data-reactid": ".0.4.0.0.2.0:$2",
    "type": "putListener",
    "args": "[\"onClick\",null]"
  }
]
@STRML
Copy link
Contributor Author

STRML commented Oct 15, 2015

Just to add some context, whether or not I use actual anchor tags doesn't seem to affect whether or not putListener gets called.

@jimfb
Copy link
Contributor

jimfb commented Oct 15, 2015

@STRML Can you provide a simplified jsfiddle which demonstrates the issue (too many putlisteners) so we can take a look.

@zpao
Copy link
Member

zpao commented Oct 15, 2015

Yea, this looks like the workaround for removing the tap delay. cc @spicyj

@STRML
Copy link
Contributor Author

STRML commented Oct 15, 2015

I'll work on a jsfiddle when I get home tonight - thanks for taking a look. The perf is a concern to me but I've been seeing crashes / error logs in Sentry due to findComponentRoot failures, and they all trace back to putListener.

@STRML
Copy link
Contributor Author

STRML commented Oct 15, 2015

Got it: https://jsfiddle.net/69z2wepo/18425/ - open the console and hit Run.

@STRML
Copy link
Contributor Author

STRML commented Oct 16, 2015

The .bind() on the handler appears to be the culprit.

@sophiebits
Copy link
Collaborator

This all appears to be expected behavior to me. When you pass a different function instance that counts as a change. Maybe we should ignore event listeners? Those updates are usually less costly and are often no-ops.

@jimfb
Copy link
Contributor

jimfb commented Oct 16, 2015

Yeah, if interacting with the DOM is slow, we could probably set a callback proxy that, when invoked, reads the actual handler off the internal instance. Then "updates" due to a bind in render would not result in a call to the DOM.

@STRML
Copy link
Contributor Author

STRML commented Oct 16, 2015

So is it considered bad form to bind in a render function or otherwise create handlers in the loop? The alternative, most of the time, is just to put the data in a data- attribute and read it on click.

@sophiebits
Copy link
Collaborator

These already don't actually interact with the DOM.

@jimfb
Copy link
Contributor

jimfb commented Oct 16, 2015

If they don't interact with the DOM, then it seems erroneous to have them print in

Perf.printDOM(measurements)
Prints the underlying DOM manipulations, e.g. "set innerHTML" and "remove".

@sophiebits
Copy link
Collaborator

I mean, that method lists every other side effect of returning a new element from render. Perhaps it's technically incorrect.

@jimfb
Copy link
Contributor

jimfb commented Oct 16, 2015

Ok, TLDR:

Conceptually the DOM is changing due to the render which creates a new function via bind(). Under the hood, React does fancy magic that avoids actually flushing those changes to the DOM. This makes the "expected behavior" of Perf.printDOM a little ambiguous.

In practice, the 97% use case is probably binds (rather than someone swapping out an event handler, which would be possible but slightly unusual). In the interest of making ReactPerf "useful" rather than "correct" @spicyj and I are in agreement that it probably makes sense to suppress logging updates to the event handlers if/when the previous value and new value are both functions.

@jimfb
Copy link
Contributor

jimfb commented Nov 2, 2015

Fixed in #5209

@jimfb jimfb closed this as completed Nov 2, 2015
conorhastings pushed a commit to conorhastings/react that referenced this issue Nov 3, 2015
Fix for lint issues

Added the test cases for the issue 5189

Removing empty space

Removing the Eventplugin instrumentation code

Removing unwanted white space
@1000hz
Copy link

1000hz commented Mar 1, 2016

I'm still seeing a bunch of "putListener" events when I call Perf.printDOM() on v0.14.7. I'm trying to diagnose some performance issues and am not sure what's going on.

After reading this thread, these are the things I am led to believe:

  • putListener instrumentation was removed from Perf.printDOM() output. ( ❌ )
  • using fn.bind(this) as a callback prop is ok even though the element is receiving a new function instance every render because React isn't touching the DOM. (:question:)
  • maybe the reason it's showing up in Perf.printDOM() is because React actually is changing the event handler on the DOM. (:question:)
  • I should probably still try not to use fn.bind(this) so that I can take advantage of pure rendering and also avoid the overhead of repeated function construction (:grey_question:)
  • my app is probably slow because of something else entirely (:grey_question:)

@1000hz
Copy link

1000hz commented Mar 2, 2016

@spicyj @zpao @gaearon any insights?

@gaearon
Copy link
Collaborator

gaearon commented Mar 2, 2016

I haven’t dived into how printDOM() or event dispatching works so I can’t say.
Interested in conclusions too.

@gaearon
Copy link
Collaborator

gaearon commented Mar 20, 2016

@1000hz

The fix from #5209 was merged into master and not into the 0.14 branch. The calls are still there in 0.14. This is why you’re seeing them.

Give 15.0 RC2 a try. It should contain the relevant fix.

@1000hz
Copy link

1000hz commented Mar 20, 2016

Ah, that makes sense. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants