Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Reviewed by Geoff.
Fix for <rdar://problem/5728171> Potential PLT speedup: don't realloc every time inside NamedAttrMap::addAttribute The speed-up for this turned out to be so small that it is mostly imperceptible. It is likely that it is a tiny boost, though, and the new code is much cleaner. * dom/Element.cpp: (WebCore::Element::setAttributeMap): attrs is now called m_attributes * dom/NamedAttrMap.cpp: The array attrs is now the Vector of RefPtrs called m_attributes, and there is no longer any need for the len member variable. (WebCore::NamedAttrMap::NamedAttrMap): (WebCore::NamedAttrMap::item): (WebCore::NamedAttrMap::getAttributeItem): (WebCore::NamedAttrMap::clearAttributes): (WebCore::NamedAttrMap::operator=): (WebCore::NamedAttrMap::addAttribute): (WebCore::NamedAttrMap::removeAttribute): (WebCore::NamedAttrMap::mapsEquivalent): * dom/NamedAttrMap.h: Same. (WebCore::NamedAttrMap::length): (WebCore::NamedAttrMap::attributeItem): (WebCore::NamedAttrMap::shrinkToLength): (WebCore::NamedAttrMap::reserveCapacity): * html/HTMLTokenizer.cpp: One of the benefits of the old array was that it never took up more memory than it needed to. So the tokenizer utilizes new member functions on NamedAttrMap (shrinkToLength and reserveCapacity) to try to keep memory usage at a minimum. (WebCore::Token::addAttribute): (WebCore::HTMLTokenizer::processToken): Canonical link: https://commits.webkit.org/24743@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
94 additions
and 70 deletions.
- +38 −0 WebCore/ChangeLog
- +1 −1 WebCore/dom/Element.cpp
- +42 −64 WebCore/dom/NamedAttrMap.cpp
- +8 −4 WebCore/dom/NamedAttrMap.h
- +5 −1 WebCore/html/HTMLTokenizer.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters