Reviewed by Oliver Hunt.
GC more promptly when navigating to a new inner window, but not at all when it went in the page cache
https://bugs.webkit.org/show_bug.cgi?id=39254
<rdar://problem/
7996370>
~1% PLT speedup
~4% iBench HTML speedup
* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectSoon): Change back to a 0 delay timer instead of
0.5 second.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::clearWindowShell): Add a new boolean parameter. Don't
garbageColectSoon if the page is going into the page cache.
* bindings/js/ScriptController.h: Prototype change for above.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear): Indicate when the page is going into the page cache.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59659
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-05-17 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ GC more promptly when navigating to a new inner window, but not at all when it went in the page cache
+ https://bugs.webkit.org/show_bug.cgi?id=39254
+ <rdar://problem/7996370>
+
+ ~1% PLT speedup
+ ~4% iBench HTML speedup
+
+ * bindings/js/GCController.cpp:
+ (WebCore::GCController::garbageCollectSoon): Change back to a 0 delay timer instead of
+ 0.5 second.
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::clearWindowShell): Add a new boolean parameter. Don't
+ garbageColectSoon if the page is going into the page cache.
+ * bindings/js/ScriptController.h: Prototype change for above.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::clear): Indicate when the page is going into the page cache.
+
2010-05-18 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
void GCController::garbageCollectSoon()
{
if (!m_GCTimer.isActive())
- m_GCTimer.startOneShot(0.5);
+ m_GCTimer.startOneShot(0);
}
void GCController::gcTimerFired(Timer<GCController>*)
static_cast<WebCoreJSClientData*>(JSDOMWindow::commonJSGlobalData()->clientData)->getAllWorlds(worlds);
}
-void ScriptController::clearWindowShell()
+void ScriptController::clearWindowShell(bool goingIntoPageCache)
{
if (m_windowShells.isEmpty())
return;
}
}
- // It's likely that resetting our windows created a lot of garbage.
- gcController().garbageCollectSoon();
+ // It's likely that resetting our windows created a lot of garbage, unless
+ // it went in a back/forward cache.
+ if (!goingIntoPageCache)
+ gcController().garbageCollectSoon();
}
JSDOMWindowShell* ScriptController::initScript(DOMWrapperWorld* world)
const String* sourceURL() const { return m_sourceURL; } // 0 if we are not evaluating any script
- void clearWindowShell();
+ void clearWindowShell(bool goingIntoPageCache = false);
void updateDocument();
// Notifies the ScriptController that the securityOrigin of the current
// Do this after detaching the document so that the unload event works.
if (clearWindowProperties) {
m_frame->clearDOMWindow();
- m_frame->script()->clearWindowShell();
+ m_frame->script()->clearWindowShell(m_frame->document()->inPageCache());
}
m_frame->selection()->clear();