PSA: embedding/applying CSS in JS is the surefire way to be on every slow path. Bloats memory, slows parsing & use, hurts caching. Avoid.
-
-
-
Replying to @iamstarkov
Please don't do that. It bloats your memory and slows parse. CSS belongs in CSS files for deployment.
3 replies 0 retweets 4 likes -
-
Replying to @iamstarkov
It blows a lot more memory than ordinary CSS. And yes, if it's strings in JS that you then assign to DOM, it's different to "regular" JS
1 reply 0 retweets 0 likes -
Replying to @slightlylate
I do not assign those objects to ordinary DOM nodes, but rather inject those objects into Style tags in the head
3 replies 0 retweets 0 likes -
Replying to @iamstarkov
Yep, so you're adding them to the DOM. They get "interned" in shared Blink/JS heap space. Not "ordinary" cost.
1 reply 0 retweets 0 likes -
Replying to @slightlylate @iamstarkov
...and you pay twice for parse (both CPU & RAM): first for JS parse of the string and the second time for CSS parse when you add to the DOM.
1 reply 0 retweets 1 like -
It helps with JS parse by putting it on a separate thread. You lose the parallelism this gains you by sticking CSS on that thread.
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.