W3C home > Mailing lists > Public > www-style@w3.org > November 2005

Re: Computational complexity of CSS

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Wed, 16 Nov 2005 18:04:43 -0600
Message-ID: <437BC91B.7050509@mit.edu>
To: Andrew Fedoniouk <news@terrainformatica.com>, Bjoern Hoehrmann <derhoermi@gmx.net>, www-style@w3.org

Malcolm Rowe wrote:
>> ".a1 > .a2" is better than ".a1 .a2"
>> "p[a1]" is better than just "[a1]",
>> etc.
>>
> 
> I think I'm right in saying that at least the second of those will
> actually be _slower_ in Gecko

Depends on what you're measuring.  "p[a1]" will take a tiny bit longer to return 
"true" for such a node, but will take a lot less time to return "false" for 
everything else (because Gecko hashes on tagname, if nothing else).  See David 
Hyatt's excellent article at http://www.mozilla.org/xpfe/goodcss.html for a 
discussion of the Gecko style system and performance.

But yes, I agree that any such suggestion would have to be implementation-dependant.

-Boris
Received on Thursday, 17 November 2005 00:05:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:41 GMT