Re: [webcomponents]: What callbacks do custom elements need?

On 3/11/13 5:27 PM, Daniel Buchner wrote:
> - I thought the concern was over the same issues that plagued mutation/events/, namely perf-crushing event bubbling sparked by frequent DOM changes.

The #1 issue with mutation events is that they insanely complicated 
implementation and specification because they ran script at all sorts of 
weird times.

The #2 issue with mutation events was that they involved firing events 
and that's an expensive process (not related to bubbling) and that the 
events insisted on having all sorts of data about the mutation, so the 
data had to be saved before the mutation, which was slow.

I had assumed that #2 is a non-issue here because we can just not expose 
too much information in the notification and we can make it trivial to 
detect quickly and reliably whether the call needs to happen at all 
(which was not possible with events).

Given that, my main concern is with #1 above.

> It's almost certainly faster but may not be worth the machinery,
> depending on how much this is actually going to be used in practice.
>
> - these four basic callbacks/mutations are essential to custom element/component development - they will be used frequently, in our experience thus far.

When you say "frequently" do you mean "90% of nodes will have listeners 
for these callbacks" or "1% of nodes on 90% of pages will have listeners 
for these callbacks"?

Or more to the point, what fraction of attribute mutations will be 
impacted by whatever performance hit there is from this?  I am assuming 
it will be low, but if it's not then we may need the extra machinery to 
reduce that fraction.

> - The target and actual audience is probably not going to be noobs/beginners

I didn't say anything about beginners.  I said people who don't care are 
usually not creating what they think of as "apps".

For example, news sites are notorious performance badness culprits.  And 
I doubt cnn.com was created by noobs.

-Boris

Received on Tuesday, 12 March 2013 00:52:17 UTC