Changeset 167589 in webkit
- Timestamp:
- Apr 21, 2014 3:15:40 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167588 r167589 1 2014-04-21 Andreas Kling <akling@apple.com> 2 3 Micro-optimize the way we hand NodeLists to JSC. 4 <https://webkit.org/b/131932> 5 6 Use HashMap::fastAdd() when returning cached node lists and collections. 7 10.9% progression on Bindings/get-elements-by-tag-name.html 8 9 Reviewed by Antti Koivisto. 10 11 * dom/NodeRareData.h: 12 (WebCore::NodeListsNodeData::addCacheWithAtomicName): 13 (WebCore::NodeListsNodeData::addCacheWithName): 14 (WebCore::NodeListsNodeData::addCacheWithQualifiedName): 15 (WebCore::NodeListsNodeData::addCachedCollection): 16 1 17 2014-04-21 Commit Queue <commit-queue@webkit.org> 2 18 -
trunk/Source/WebCore/dom/NodeRareData.h
r167220 r167589 121 121 PassRef<T> addCacheWithAtomicName(ContainerType& container, const AtomicString& name) 122 122 { 123 NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches. add(namedNodeListKey<T>(name), nullptr);123 NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.fastAdd(namedNodeListKey<T>(name), nullptr); 124 124 if (!result.isNewEntry) 125 125 return static_cast<T&>(*result.iterator->value); … … 133 133 PassRef<T> addCacheWithName(ContainerNode& node, const String& name) 134 134 { 135 NodeListNameCacheMap::AddResult result = m_nameCaches. add(namedNodeListKey<T>(name), nullptr);135 NodeListNameCacheMap::AddResult result = m_nameCaches.fastAdd(namedNodeListKey<T>(name), nullptr); 136 136 if (!result.isNewEntry) 137 137 return static_cast<T&>(*result.iterator->value); … … 145 145 { 146 146 QualifiedName name(nullAtom, localName, namespaceURI); 147 TagNodeListCacheNS::AddResult result = m_tagNodeListCacheNS. add(name, nullptr);147 TagNodeListCacheNS::AddResult result = m_tagNodeListCacheNS.fastAdd(name, nullptr); 148 148 if (!result.isNewEntry) 149 149 return *result.iterator->value; … … 157 157 PassRef<T> addCachedCollection(ContainerType& container, CollectionType collectionType, const AtomicString& name) 158 158 { 159 CollectionCacheMap::AddResult result = m_cachedCollections. add(namedCollectionKey(collectionType, name), nullptr);159 CollectionCacheMap::AddResult result = m_cachedCollections.fastAdd(namedCollectionKey(collectionType, name), nullptr); 160 160 if (!result.isNewEntry) 161 161 return static_cast<T&>(*result.iterator->value); … … 169 169 PassRef<T> addCachedCollection(ContainerType& container, CollectionType collectionType) 170 170 { 171 CollectionCacheMap::AddResult result = m_cachedCollections. add(namedCollectionKey(collectionType, starAtom), nullptr);171 CollectionCacheMap::AddResult result = m_cachedCollections.fastAdd(namedCollectionKey(collectionType, starAtom), nullptr); 172 172 if (!result.isNewEntry) 173 173 return static_cast<T&>(*result.iterator->value);
Note: See TracChangeset
for help on using the changeset viewer.