Email or username:

Password:

Forgot your password?
Top-level
Anthony

@nolan I wonder if removing `loading=lazy` after landing github.com/nolanlawson/emoji-p might yield a bit more performance: loading images eagerly could save the browser from doing the bookkeeping and querying to know if it should load now or later.

If it does, you might want to replace `contentvisibilityautostatechange` with a real `IntersectionObserver` to avoid regressing on browsers without that event.

2 comments
Nolan Lawson

@anthony That's interesting; I'll toy around with that!

What prompted this was noticing a huge amount of time Chromium is spending in "ResourceFetcher::requestResource" (visible if you turn on "show all events"). I had a hunch that this was related to the `<img>`s, so I removed the `src` and suddenly all the costs went away. I'll need to dig to see if it's `loading=lazy`-related…

As for IntersectionObserver, yes, I messed around with that too. It's definitely the better cross-browser choice.

Screenshot of Chrome DevTools profiler with a big gray block saying ResourceFetcher::requestResource
Nolan Lawson

@anthony Hm, `loading=lazy` doesn't affect those `ResourceFetcher` costs… Still might make sense to get rid of, though, if I'm effectively doing my own lazy-loading.

Go Up