Closed Eeems closed 3 years ago
You likely can avoid some repaints if you split out some stuff to run in DOMContentLoaded that would be making larger DOM changes, sure it slows down first paint slightly, but it's probably going to still result in a faster time to interactive technically.
I picked the
load
event here mostly because some of the Tweaks may depend on it while others won't be harmed by it.Additionally, I want the page to be interactive as fast as possible, so that means running as few scripts as possible before
load
.