Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cb65a1a9caa7c9e6dcd70d1548ebf9e354a69031
https://github.com/WebKit/WebKit/commit/cb65a1a9caa7c9e6dcd70d1548ebf9e354a69031
Author: Keith Miller <[email protected]>
Date: 2024-08-15 (Thu, 15 Aug 2024)
Changed paths:
M Source/JavaScriptCore/heap/Heap.cpp
M Source/JavaScriptCore/heap/Heap.h
M Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.cpp
M Source/JavaScriptCore/heap/StochasticSpaceTimeMutatorScheduler.cpp
M Source/JavaScriptCore/runtime/VM.cpp
M Source/WTF/wtf/PrintStream.h
M Source/WebCore/page/OpportunisticTaskScheduler.cpp
Log Message:
-----------
Defer GC while compiling wasm modules
https://bugs.webkit.org/show_bug.cgi?id=278183
rdar://133973759
Reviewed by Yusuke Suzuki.
Right now when we start to compile a wasm module we typically end up allocating
a
Wasm::Memory. Since Wasm::Memories tend to be VERY large (some multiple of 64KB)
this typically triggers a GC. However since most of the additional memory is
from
a Wasm::Memory, which likely won't be free for a while we don't collect much and
spend a lot of critical CPU time GCing. We could have just deferred GC by
forcing
GC to be deferred but that felt overly aggressive. Instead this patch introduces
a concept of oversized allocations which is anything >= 64KB (smaller numbers
weren't sufficient). When the last oversized allocation is more than 1/3 of the
total bytes allocated this cycle we now defer GC.
Just deferring GC from collectIfNecessaryOrDefer was still insufficient to stop
GCs during compilation. We also have to force OpportunisticTaskScheduler to
defer
timer based GCs while wasm compilation is going on.
This seems to be a .5-1% JetStream progression and weirdly might also be a
RAMification win too. Also seems neutral for other memory tests and Speedometer.
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::reportAbandonedObjectGraph):
(JSC::Heap::runBeginPhase):
(JSC::Heap::willStartCollection):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::didAllocate):
(JSC::Heap::collectIfNecessaryOrDefer):
* Source/JavaScriptCore/heap/Heap.h:
(JSC::Heap::totalBytesAllocatedThisCycle):
* Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.cpp:
(JSC::SpaceTimeMutatorScheduler::beginCollection):
(JSC::SpaceTimeMutatorScheduler::bytesAllocatedThisCycleImpl):
* Source/JavaScriptCore/heap/StochasticSpaceTimeMutatorScheduler.cpp:
(JSC::StochasticSpaceTimeMutatorScheduler::beginCollection):
(JSC::StochasticSpaceTimeMutatorScheduler::bytesAllocatedThisCycleImpl):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::performOpportunisticallyScheduledTasks):
* Source/WTF/wtf/PrintStream.h:
(WTF::ConditionalDump::ConditionalDump):
(WTF::ConditionalDump::dump const):
* Source/WebCore/page/OpportunisticTaskScheduler.cpp:
(WebCore::OpportunisticTaskScheduler::FullGCActivityCallback::doCollection):
(WebCore::OpportunisticTaskScheduler::EdenGCActivityCallback::doCollection):
Canonical link: https://commits.webkit.org/282325@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes