When it comes to CSS performance, I would like you to remember this one thing:
"Architecture is outside the braces, performance is inside." | ||
| --Ben Frain | ||
Let me expand on my little maxim:
As far as I am able to prove, worrying about whether a CSS selector (the part outside the curly braces), is fast or slow is pointless. I set out to prove this at http://benfrain.com/css-performance-revisited-selectors-bloat-expensive-styles/.
However, one thing that really can grind a page to a halt, CSS wise, is 'expensive' properties (the parts inside the curly braces). When we use the term 'expensive', in relation to certain styles, it simply means it costs the browser a lot of overhead. It's something that the browser finds overly taxing to do.
It's possible to take a common sense guess about what will likely cause the browser extra work. It's basically anything it would have to compute before it can paint things to the screen. For example, compare a standard div with a flat solid background, against a semi-opaque image, on top of a background made up of multiple gradients, with rounded corners and a drop-shadow. The latter is more expensive; it will result in far more computational work for the browser and subsequently cause more overhead.
Therefore, when you apply effects like filters, do so judiciously and, if possible, test whether the page speed suffers on the lowest powered devices you are hoping to support. At the least, switch on development tool features such as continuous page repainting in Chrome and toggle any affects you think may cause problems. This will provide you with data (in the form of a millisecond reading of how long the current viewport is taking to paint) to make a more educated decision on which effects to apply. The lower the figure, the faster the page will perform (although be aware that browsers/platforms vary so, as ever, test on real devices where possible).
For more on this subject I recommend the following resource:
https://developers.google.com/web/fundamentals/performance/rendering/

In the near future, CSS will be able to offer masks and clipping as part of the CSS Masking Module Level 1. These features will enable us to clip an image with a shape or arbitrary path (specified via SVG or a number of polygon points). Sadly, despite the specification being at the more advanced CR stage, as I write this, the browser implementations are just too buggy to recommend. However, it's a fluid situation so by the time you are reading this, there's every chance the implementations will be solid. For the curious, I'll therefore refer you to the specification at http://www.w3.org/TR/css-masking/.
I also think Chris Coyier does a great job of explaining where things are at support wise in this post:
http://css-tricks.com/clipping-masking-css/
Finally, a good overview and explanation of what will be possible is offered by Sara Soueidan in this post: