4 ms·
box-shadow is seriously slow We had a site with the main content area shadowing over the nav bar. When the browser window was large on my big monitor scrolling
by snprbob86 16y ago
box-shadow is seriously slow
We had a site with the main content area shadowing over the nav bar. When the browser window was large on my big monitor scrolling was very sluggish. SpeedTracer (in Chrome) was reporting 90 to 110ms times per render, dozens per flick of the mouse wheel! Replacing the box-shadow with an image resulted in 6 to 10ms per render: silky smooth.
- lovskogen 16y agoYeah box-shadow is the worst, especially if you scroll. So I wonder why the author doesn't mention this.
- BasDirks 16y agobox-shadow > 12px (radius) get's bad. It's possible to have a dozen or more elements with box-shadow < 8px (radius), and have the same performance as one element with box-shadow > 18px.