Skip to content

Page performance lag when scrolling on a page with Lenis and lots of images #307

Closed Answered by iamlinkus
henrybabbage asked this question in Q&A
Discussion options

You must be logged in to vote

@henrybabbage I tried profiling your webpage and noticed that what takes most of the time when scrolling is the browser painting the actual images. This is because most of the images you're loading in ultra high resolution (3840x2561 for example). This is unnecessarily huge and the browser has to do A LOT when it paints each frame.

Optimizing the image resolutions should be the very first step in mitigating these performance issues. Whenever you encounter stuttering or lag, it's always super helpful to give a peek to the profiler (chrome dev tools).

It's working better in the stackblitz because it's loading in smaller images (because of how the srcset for the images is set up) because of …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@henrybabbage
Comment options

@iamlinkus
Comment options

Answer selected by clementroche
@henrybabbage
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants