Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(884)

Unified Diff: Source/core/dom/shadow/DistributedNodes.h

Issue 1333813002: Oilpan: Remove reserveInitialCapacity from DistributedNodes' constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/DistributedNodes.h
diff --git a/Source/core/dom/shadow/DistributedNodes.h b/Source/core/dom/shadow/DistributedNodes.h
index 4259c7e4503724915c6a01744feef01881fd2efc..89f945df24fa6dd655f83563e0b93d6505dc286b 100644
--- a/Source/core/dom/shadow/DistributedNodes.h
+++ b/Source/core/dom/shadow/DistributedNodes.h
@@ -40,7 +40,23 @@ namespace blink {
class DistributedNodes final {
DISALLOW_ALLOCATION();
public:
- DistributedNodes() { m_nodes.reserveInitialCapacity(32); }
+ DistributedNodes()
+ {
+#if !ENABLE(OILPAN)
+ // The reserveInitialCapacity(32) was introduced in r157725 just to
+ // prevent a regression in micro-benchmarks without doing serious
+ // performance measurement. This may be working well in non-oilpan,
+ // but in oilpan this regresses performance of benchmarks that create
+ // a lot of elements that have a shadow root but don't have any
+ // distributed nodes. This is because the vector buffer adds a
+ // substantial amount of pressures on Oilpan's heap and increases
+ // GC frequency. On the other hand, there is few disadvantage in
+ // not calling reserveInitialCapacity(32) since Oilpan implements
+ // a smart allocator that can expand/shrink vectors without reallocating
+ // the contents.
+ m_nodes.reserveInitialCapacity(32);
+#endif
+ }
PassRefPtrWillBeRawPtr<Node> first() const { return m_nodes.first(); }
PassRefPtrWillBeRawPtr<Node> last() const { return m_nodes.last(); }
@@ -60,8 +76,6 @@ public:
void swap(DistributedNodes& other);
- const WillBeHeapVector<RefPtrWillBeMember<Node>>& nodes() const { return m_nodes; }
esprehn 2015/09/15 00:29:41 unrelated?
-
DECLARE_TRACE();
private:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698