4 ms·
does this have a performance benefit or are you recommending it for the code clarity?
by Blahah 9y ago
does this have a performance benefit or are you recommending it for the code clarity?
- esprehn 9y agoIt'll increase your parse and network transfer time (gzip might help there though) in exchange for reduced selector matching and style computation time. How much that matters probably depends on your content, how big the document is, how much CSS you have and how many classes you're using. If you're talking about the difference of: .a { ... } .b { ... } .ab { ... } <div class="a b"></div> <div class="ab"></div> It's probably not going to matter a lot. It's two map lookups vs one, and some associated overhead. Probably better to optimize elsewhere. :)