I'm suspecting style.cssText and using cloneNode can be more efficient than large files w/ selectors in some scenarios. Experimental tho.
-
-
Replying to @sebmarkbage @threepointone and
cloneNode + shadow DOM's is a HUGE win. We de-dupe rules inside shadows & use separate (faster!) resolver.
1 reply 0 retweets 3 likes -
Replying to @slightlylate @threepointone and
With style sheets it is difficult to be granular, bc the overhead of network/DOM per sheet, so you end up parsing rules you don't use.
1 reply 0 retweets 1 like -
Replying to @sebmarkbage @threepointone and
...but that stylesheet construction is going to be faster than doing this through JS until you get a *very* large stylesheet.
2 replies 0 retweets 2 likes -
Replying to @slightlylate @threepointone and
That's where the problem space gets interesting. Finding the sweet spot where it matters and fixing the bottlenecks that makes it slow now.
1 reply 0 retweets 2 likes -
Replying to @sebmarkbage @threepointone and
Strongly recommend you look at Shadow DOM + cloneNode for shared chunks.
2 replies 0 retweets 8 likes -
Replying to @slightlylate @sebmarkbage and
Do you have any reading material on this? Or does it just refers to shadow dom being fast and encapsulated?
1 reply 0 retweets 0 likes -
Replying to @wardpeet @sebmarkbage and
I don't know of articles on it;
@ElliottZ might3 replies 0 retweets 0 likes -
Replying to @slightlylate @wardpeet and
Inline style (.style.foo = ...) or setting .cssText is probably the slowest way to apply style. Classes and ids would be the fastest.
1 reply 4 retweets 24 likes -
Replying to @ElliottZ @slightlylate and
Not quite the same thing. Using .style.setProperty(...) is more relevant and much faster in most browsers (IE being an exception)
1 reply 0 retweets 0 likes
I'm sitting here looking at the setProperty code and I can't understand how that's possibly true; invokes parsing: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/StylePropertySet.cpp?type=cs&l=321 …
-
-
Replying to @slightlylate @DavidKPiano and
Might get fewer property invalidations, but you trade that for more passes through the bindings; not a trade I'd naively make (need to test)
1 reply 0 retweets 0 likes -
Replying to @slightlylate @ElliottZ and
Here's the numbers (let me know if I can improve this test): https://esbench.com/bench/5908f78199634800a0347e94 …pic.twitter.com/vq4sjYvgFw
1 reply 0 retweets 3 likes - 10 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.