-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=263096 rdar://113579564 Reviewed by Brent Fulgham. Add a ProcessAssertion cache to avoid hammering RunningBoard when switching quickly from one assertion type to another (e.g. background <-> foreground). Taking RunningBoard assertions is expensive and this churn can result in high CPU usage. We have evidence this can happen for example when we're holding a background assertion on the WebProcess but the client app keeps running JS in the view, causing us to take a foreground assertion for each JS execution request. We now keep previous assertions around for 3 seconds when switching from one assertion type to another and we reuse them when possible. * Source/WebKit/UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessAssertionCache::add): (WebKit::ProcessThrottler::ProcessAssertionCache::tryTake): (WebKit::ProcessThrottler::ProcessAssertionCache::remove): (WebKit::ProcessThrottler::ProcessAssertionCache::CachedAssertion::CachedAssertion): (WebKit::ProcessThrottler::ProcessAssertionCache::CachedAssertion::isValid const): (WebKit::ProcessThrottler::ProcessAssertionCache::CachedAssertion::release): (WebKit::ProcessThrottler::ProcessAssertionCache::CachedAssertion::entryExpired): (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::ProcessThrottler::setThrottleState): * Source/WebKit/UIProcess/ProcessThrottler.h: Canonical link: https://commits.webkit.org/269319@main
- Loading branch information
Showing
2 changed files
with
76 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters