Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

mix-blend-mode on images affects performance #6

Open
cadars opened this issue Mar 4, 2021 · 1 comment
Open

mix-blend-mode on images affects performance #6

cadars opened this issue Mar 4, 2021 · 1 comment

Comments

@cadars
Copy link

cadars commented Mar 4, 2021

I noticed that the fan of my laptop (2014 MacBook Pro, Chromium) kicks in when scrolling image-heavy pages, the homepage in particular.

When removing the mix-blend-mode CSS rule, scrolling becomes smooth again, and the GPU is less solicited.
https://stackoverflow.com/questions/33795350/mix-blend-mode-scroll-lag-issues

Unsure about this, but maybe using isolation: isolate; on the containing element might help?
https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode#HTML_example

I believe that fixing this issue would minimize the energy consumption for the user/client.

@rscmbbng
Copy link
Collaborator

rscmbbng commented Mar 8, 2021

I've managed to confirm the effect indeed with a simple test: Scrolling through an article while recording the performance with firefox's inspector.

Default: 13% of computation is for graphics calls and 82% of the time the browser is idle.
Isolate: 10% of computation is for graphics calls and 84% the browser is idle.
No blend mode: 2% of computation is for graphics rendering calls and 93% of the time the browser is idle.

I do not like the look of isolate and the gains are minimal. Instead, disabling CSS blend modes and precomputing all color swatches seems the more logical approach. However, I'll have to discuss it with the team and find the time..

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants