New issue
Advanced search Search tips

Issue 842474 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

"Performance monitor" DOM nodes / events count seems way off (dev tools leaking into it?)

Reported by daniel.a...@gmail.com, May 12 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36

Steps to reproduce the problem:
1. Create a HTML page with 1000 DOM elements and 1000 event listeners.
2. Look at the dev tools performance monitor's DOM nodes and events count
3. Compare these numbers with `document.querySelectorAll('*').length` and `getEventListeners()` on all DOM nodes.

What is the expected behavior?
DOM nodes and events count should both be 1000.

What went wrong?
The numbers are way off, e,g. four times the expected DOM nodes count.
In addition, when using the dev tools "Elements" tab and hovering over DOM elements there, the performance monitor's DOM nodes and events count starts to highly fluctuate which makes me believe that the dev tools actually leak into the performance monitor's statistics. 

Did this work before? N/A 

Chrome version: 66.0.3359.170  Channel: stable
OS Version: OS X 10.13.0
Flash Version: 

I also put this on stackoverflow including an example and the code I run to manually count DOM nodes / events: https://stackoverflow.com/questions/50306382/number-of-dom-nodes-events-calculated-inconsistent-with-numbers-in-chrome-dev-to
 
devtools.mp4
1.1 MB View Download
Labels: Needs-Triage-M66
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

@Reporter: As it would be out of scope for us to Create an HTML page with 1000 DOM elements and 1000 event listeners, Could you please provide us with a sample test file/URL which helps us to triage the issue in a better way. Any further inputs from your end may be helpful.

Comment 3 by alph@chromium.org, May 14 2018

Owner: alph@chromium.org
Status: Assigned (was: Unconfirmed)
An example can be seen here: https://js-zfgaya.stackblitz.io/

It creates ~1020 DOM nodes and 1000 event handlers. Each click on a <li/> removes an event handler, after 10 removals ALL event handlers are removed. The Performance monitor does not reflect this as expected.

Sign in to add a comment