Tagged “optimization”
-
TIL Performance tests performance javascript optimization
While doing performance tests, I was curious how long a loop was running. I used the performance.now() trick.
-
TIL self-hosting your own Google Fonts fonts optimization cdn selfhost
I'm all for self-hosting. So seeing this question asked 'Should you self-host Google Fonts?', my immediate answer is ABSOLUTELY. But here's the edge-cases.
-
TIL loading third-party scripts onto service workers serviceworker javascript cache optimization
An alternative to self-hosting scripts would be using Service Workers to cache them. This can give you greater control over how often they are re-fetched from the network. This could also be used to create a loading strategy where requests for non-essential third parties are throttled until the page reaches a key user moment.
-
TIL Event Delegation javascript optimization events
Event delegation is one of the most helpful patterns for DOM events! Adding too many event listeners means JavaScript is storing it all in memory. Event Delegation lets you store one listener, that then looks for the target.
-
TIL using defer/async optimization javascript mdn
So an old and often-touted best practice for performance has been to load your JavaScript in the footer of the document to avoid render blocking of scripts. By putting it in the footer, the DOM is constructed before your scripts have a chance to run. That's dumb.
-
TIL Find unused JavaScript javascript devtools optimization
Chrome's Coverage panel allows you to quickly locate JavaScript (and CSS) code that has — and has not — been used. To start, open Coverage from the More tools sub-menu in the DevTools menu
-
TIL how a dev cut GTA Online load times by 70% gamedev optimization videogames
In all, t0st estimates that 1,984,531,500 checks take place (nearly two billion!), again taking up a ton of CPU time.
-
TIL Optimizations with closures javascript closures optimization
To reduce the number of times a variable gets computed, you can use closures. Closures work by storing references to the outer function’s variables. They do not store the actual value.
-
TIL Copy/Paste SVG Icons html svg optimization generator
And by inlining the SVG, you make one less call, and it loads faster. heroicons.dev is awesome
-
TIL this Responsive Image Generator html optimization
With website optimization, it's better to deliver only the image that the browser size needs. Do that here.
-
TIL Server-side rendering vs Static Generation optimization
Server-side sends a fully rendered page to the client. Client-side, you cannot interact with the site, and instead will need to wait for all of the JS to download, to allow the SPA framework to operate.
See all tags.