[webkit-dev] Performance of NamedAttrMap
snej at chromium.org
Thu Oct 29 14:30:00 PDT 2009
I was looking at the performance of Element.getAttribute(), and I see
that NamedAttrMap, which actually stores the attributes, is
implemented as an unsorted array. This makes looking up an attribute
an O(n) operation. Is there any reason this couldn't be optimized to
use a HashMap, or at least binary search?
(I thought the answer might be that the order of attributes is
significant; but I just checked the DOM spec, and NamedNodeMap is
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev