Version: 20221211
Invented in IE8, some resources are downloaded asynchronously/parallel. Resources in this scanner will always perform better than those that are not.
<img>
is an example of a resource in that scanner.
rel=preload
- this resource hint re-introduces item to preload scanner. But use it sparingly. This usually goes in the <head>
For images above the fold:fetchpriority=high
- Priority Hints. This usually goes in the <body>
. Useful for in-page resources.decoding=sync
- Decoding images.For images below the fold:
loading=lazy
anddecoding=async
MeasureThat.net: Compare performance of JavaScript code, e.g.
HTML:
<div id="testElement"></div>
JavaScript:
let el = document.querySelector('#testElement');
VS
let el = document.getElementById('testElement');
document.querySelector x 5,467,960 ops/sec ±0.57% (66 runs sampled)
document.getElementById x 39,677,211 ops/sec ±0.25% (69 runs sampled)