Polymer Performance Patterns Video- Questions on Shadow dom faster than Shady and async on Link

50 views
Skip to first unread message

Darin Hensley

unread,
Nov 8, 2015, 11:03:12 PM11/8/15
to Polymer
After watching the Polymer Performance Patterns (The Polymer Summit 2015), I had a couple of questions please:

1) For the async attribute on a link tag- will that work? I see in W3C async documentation that it only mentions it being used on the <script> tag. 

2) Will async parent attribute apply to children <script> tags? For instance, <link rel="import" href="imports.html" async> and imports.html contains several <link>s and <script> tags without async attributes.

3) I thought Shady Dom was faster. But in the video it mentions for the best performance set Polymer to use Shadow. Can this be explained, please? In the context that Shady was developed to be faster but Shadow is actually faster, please. 

Thank you,
-Darin


Eric Bidelman

unread,
Nov 9, 2015, 12:58:02 PM11/9/15
to Darin Hensley, Polymer
On Sun, Nov 8, 2015 at 8:03 PM Darin Hensley <darin....@gmail.com> wrote:
After watching the Polymer Performance Patterns (The Polymer Summit 2015), I had a couple of questions please:

1) For the async attribute on a link tag- will that work? I see in W3C async documentation that it only mentions it being used on the <script> tag. 

Of course. Why would I have talked about it if it didn't work? :)


2) Will async parent attribute apply to children <script> tags? For instance, <link rel="import" href="imports.html" async> and imports.html contains several <link>s and <script> tags without async attributes.


"scripts inside them are processed in order. This means you get defer-like behavior while maintaining proper script order"


3) I thought Shady Dom was faster. But in the video it mentions for the best performance set Polymer to use Shadow. Can this be explained, please? In the context that Shady was developed to be faster but Shadow is actually faster, please. 

The boils down to polyfills vs native APIs. The Shady DOM "polyfill" was developed to be a fast shadow dom-like solution, one that works well in all browsers, today. It has better performance than using the full shadow dom polyfill.

Shadow DOM is faster when the browser supports in natively (current chrome, others coming soon). Shady DOM is merely a stop-gap solution to the real thing. So IMO, if the browser supports the native technology, you should use it.
 

Thank you,
-Darin


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/1dccd2d7-cff1-40cd-926b-72bb7e3cb69a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages