5 ms·
CSS3 vs. CSS: A Speed Benchmark
- someone_here 15y agoThis is the kind of benchmark I like to see for any technology. Anyone know of anything similar for other web technologies?
- lloeki 15y agoIndeed. Although it is "just one experiment, and the outcome was influenced by [his] own abilities." this kind of "benchmark" is what gives me ammo against grumpy, entranched dev who goes "new_foo is useless anyway, I can do that with old_bar too", and to make a hesitant hierarchy finally make a leap forward instead of clinging into aging, "mastered" technology.
- inji 15y agoIf the differences between css3 and no-css3 is so small as in this test (a few rounded corners, some drop shadows and some tiny gradients), you should totally go with pure css3 since it'll get easier to maintain but still look decent in old browsers. If you're having heavy artwork which will have huge impact on the experience; go with images (perhaps a mix?)
- lovskogen 15y agoGah. That's obvious. But he didn't test the _performance_. That's the real pain of CSS3 versus CSS. Try using box-shadow, or lots of gradients on a medium old machine – then you'll get a sluggish experience.
- snprbob86 15y agobox-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 15y agoYeah box-shadow is the worst, especially if you scroll. So I wonder why the author doesn't mention this.
- BasDirks 15y 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.
- mgcross 15y agoI appreciate the comparison, and I know it's nitpicking, but those images seem much heavier than they need to be. Using JPGs and/or 8-bit PNGs for the header and sub images could have saved 400K or so.