Weekly Shaarli

All links of one week in a single page.

Week 29 (July 19, 2021)

"The performance effects of too much lazy-loading", Rick Viscomi (@rick_viscomi) & Felix Arntz (@felixarntz)

If your site uses native image lazy-loading, check how it's implemented and run A/B tests to better understand its performance costs. It may benefit from more eagerly loading images above the fold.

"Images are hard", Chris Coyier (@chriscoyier)

Putting images on websites is incredibly simple, yes? Actually, yes, it is. You use <img> and link it to a valid source in the src attribute and you’re done. Except that there are (counts fingers) 927 things you could (and some you really should) do that often go overlooked. Let’s see…

Looping over Arrays: `for` vs. `for-in` vs. `.forEach()` vs. `for-of`

As we have seen, the for-of loop beats for, for-in, and .forEach() w.r.t. usability.

Any difference in performance between the four looping mechanisms should normally not matter. If it does, you are probably doing something very computationally intensive and switching to WebAssembly may make sense.