pupgray / walltaker

Take control of your friends wallpapers
5 stars 5 forks source link

drastically improve firefox scroll performance, minor chrome improvement #18

Closed kemagain closed 7 months ago

kemagain commented 8 months ago

this is a short 3-line CSS change

it turns out that browsers are really inefficient at repainting filtered images that are rendered transparently. Firefox is the worst about this, going from ~70-80% usage of my intel igpu to ~20-30% after the change when fervently scrolling. Chrome also has a bump, although it doesn't barf nearly as hard to begin with: ~25-30% to ~20-25%. This has more significant implications on mobile devices.

using will-change: transform to force them into a GPU surface fixes this performance, but with one caveat: the transparent link number text/emoji slightly changes colors, as the color dodge filter now no longer factors in the page's background. I added some contrast and saturation to try and keep the emojis from looking too washed out, but the colors still don't match exactly.

kemagain commented 8 months ago

converting to draft because i forgor that the link page uses a separate css class

kemagain commented 8 months ago

ok, unfucked my bad commit, should be fine now.

kemagain commented 8 months ago

pretty sure i'm dumb and the pr is still wrong. don't write css while hungry, kids. sorry for the delay, will finish my userscript first so that i'm sure I know what CSS rules are actually needed

kemagain commented 8 months ago

I genuinely resent the fact that I only ever notice my code is shit after I send a PR--the last time, I just had a redundant rule because of my yam brain.

There really ain't much to this PR but goddamn am I bad at braining my way through CSS some days.

pupgray commented 7 months ago

LGTM!