New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 659918 link

Starred by 1 user

Issue metadata

Status: Fixed
Last visit > 30 days ago
Closed: Nov 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

issue 351146
issue 451347

Sign in to add a comment

Add TRACE to Custom Elements

Project Member Reported by, Oct 27 2016

Issue description

See Issue 451347. Here I'm forking off the custom element part.

I'm not sure what the right granularity is for trace events. Nat, can you guide me?

Here's ones which should be a no-brainer I think:

- super() (Sadly, expensive.)
- define() If this is slow it will be upgrade. We could break that out separately but not sure it's interesting to do that.

One I'm less sure about:

- Callback by element type. These could be chatty. On the other hand if you have a bunch of custom elements running around and "it's slow" then I imagine that would be a useful breakdown to have.

sorvell, do you have ideas? Could you loop in other Polymon who've worked on custom element perf and have a wishlist?
Blocking: 351146
Tentative patch up at

Feedback welcome on what would be useful. I think you learn a lot by tracing your V8 methods, or is overhead of eg custom element reaction dispatch itself of interest?
Project Member

Comment 3 by, Nov 1 2016

The following revision refers to this bug:

commit 82e96780380b30193a27d412282cda8ca103c382
Author: dominicc <>
Date: Tue Nov 01 03:23:50 2016

Add tracing to custom elements operations

This adds traces in the 'blink' category to:

- customElements.define (which could take arbitrarily long given upgrades)
- HTMLConstructor (which is unavoidable cost per-instance, so of interest)
- reaction queue invoking (you could probably work this out from JS stacks, but
  it is an interesting landmark and its overhead may be of interest)

BUG= 659918 

Cr-Commit-Position: refs/heads/master@{#428924}


Status: Fixed (was: Started)
Now you can go to chrome://tracing and turn on the 'blink' category and look for:

HTMLConstructor <-- time spent in "super()"
CustomElementReactionQueue::invokeReactions <-- callbacks incl dispatch overhead
CustomElementRegistry::define <-- define including in-document upgrade

invokeReactions and define have a 'name' property that tells you the custom element name eg x-foo. It's not easy to do that for super() but it should be possible to work out which element it is from the JavaScript stack above the event.

I'm closing this for now, but please let me know if you need more/different/etc.

These traces might be useful in pursuit of Issue 351146.

Sign in to add a comment