Title: [197552] trunk/Source/WebCore
Revision
197552
Author
[email protected]
Date
2016-03-04 01:03:00 -0800 (Fri, 04 Mar 2016)

Log Message

Drop DocumentSharedObjectPool immediately when going into PageCache.
<https://webkit.org/b/154986>

Reviewed by Antti Koivisto.

The DocumentSharedObjectPool is a weirdly efficient little optimization
that deduplicates ElementData during the first 10s of a Document's lifetime.
While it's up, every ElementData created will persist so it can be used for
deduplication.

If a Document goes into the PageCache while its shared object pool is still
alive, we can just kill it right away. This will sometimes allow us to free
a bunch of ElementData sooner.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setInPageCache):
(WebCore::Document::clearSharedObjectPool):
(WebCore::Document::sharedObjectPoolClearTimerFired): Deleted.
* dom/Document.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (197551 => 197552)


--- trunk/Source/WebCore/ChangeLog	2016-03-04 08:27:36 UTC (rev 197551)
+++ trunk/Source/WebCore/ChangeLog	2016-03-04 09:03:00 UTC (rev 197552)
@@ -1,3 +1,26 @@
+2016-03-04  Andreas Kling  <[email protected]>
+
+        Drop DocumentSharedObjectPool immediately when going into PageCache.
+        <https://webkit.org/b/154986>
+
+        Reviewed by Antti Koivisto.
+
+        The DocumentSharedObjectPool is a weirdly efficient little optimization
+        that deduplicates ElementData during the first 10s of a Document's lifetime.
+        While it's up, every ElementData created will persist so it can be used for
+        deduplication.
+
+        If a Document goes into the PageCache while its shared object pool is still
+        alive, we can just kill it right away. This will sometimes allow us to free
+        a bunch of ElementData sooner.
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::setInPageCache):
+        (WebCore::Document::clearSharedObjectPool):
+        (WebCore::Document::sharedObjectPoolClearTimerFired): Deleted.
+        * dom/Document.h:
+
 2016-03-04  Youenn Fablet  <[email protected]>
 
         Remove PassRefPtr from ThreadableLoader and relatives

Modified: trunk/Source/WebCore/dom/Document.cpp (197551 => 197552)


--- trunk/Source/WebCore/dom/Document.cpp	2016-03-04 08:27:36 UTC (rev 197551)
+++ trunk/Source/WebCore/dom/Document.cpp	2016-03-04 09:03:00 UTC (rev 197552)
@@ -532,7 +532,7 @@
     , m_scheduledTasksAreSuspended(false)
     , m_visualUpdatesAllowed(true)
     , m_visualUpdatesSuppressionTimer(*this, &Document::visualUpdatesSuppressionTimerFired)
-    , m_sharedObjectPoolClearTimer(*this, &Document::sharedObjectPoolClearTimerFired)
+    , m_sharedObjectPoolClearTimer(*this, &Document::clearSharedObjectPool)
 #ifndef NDEBUG
     , m_didDispatchViewportPropertiesChanged(false)
 #endif
@@ -4599,6 +4599,7 @@
 
         clearStyleResolver();
         clearSelectorQueryCache();
+        clearSharedObjectPool();
     } else {
         if (childNeedsStyleRecalc())
             scheduleStyleRecalc();
@@ -5045,9 +5046,10 @@
     m_cachedResourceLoader->clearPreloads();
 }
 
-void Document::sharedObjectPoolClearTimerFired()
+void Document::clearSharedObjectPool()
 {
     m_sharedObjectPool = nullptr;
+    m_sharedObjectPoolClearTimer.stop();
 }
 
 #if ENABLE(TELEPHONE_NUMBER_DETECTION)

Modified: trunk/Source/WebCore/dom/Document.h (197551 => 197552)


--- trunk/Source/WebCore/dom/Document.h	2016-03-04 08:27:36 UTC (rev 197551)
+++ trunk/Source/WebCore/dom/Document.h	2016-03-04 09:03:00 UTC (rev 197552)
@@ -1721,7 +1721,7 @@
 
     RefPtr<NamedFlowCollection> m_namedFlows;
 
-    void sharedObjectPoolClearTimerFired();
+    void clearSharedObjectPool();
     Timer m_sharedObjectPoolClearTimer;
 
     std::unique_ptr<DocumentSharedObjectPool> m_sharedObjectPool;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to