googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

Consider delaying MutationObserver.observe to not happen during template stamping #181

Open ajklein opened 9 years ago

ajklein commented 9 years ago

In a <template repeat> with a lot of nested templates, this call to MutationObserver.observe shows up as a small but not invisible part of the time spent. This is not a huge deal (5ms out of 425ms in the case I'm looking at, with 550 templates), but given how rarely ref is used (and even more rarely mutated), this seems like unnecessary overhead. One could imagine delaying the observation with a setTimeout.