| Summary: | Don't update MemoryCache during drawImage if the image is decoded into DiscardableMemory | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | Images | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ap, darin, jean-yves.avenard, koivisto, sabouhallawa, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ahmad Saleem
2022-12-27 17:51:34 PST
Is "discardable memory" a concept we have in WebKit too? (In reply to Darin Adler from comment #2) > Is "discardable memory" a concept we have in WebKit too? Searching "DiscardableMemory" in GitHub does not show anything and I tried this on Local branch few days back and tried some Canvas benchmark but it does not seems to increase fps. My testing could be flawed and might not be targeting right benchmarks (I was just googling and opening StackOverflow benchmark mentioning Webkit being slow on Canvas) but this is what I have tried so far with my local testing etc. I don't know how much helpful it would be. Sorry, if it isn't much. While I don't have an answer about "discardable memory", I don't think that this optimization applies to WebKit, because CachedResource::didAccessDecodedData is already quick when the resource is not in cache:
void CachedResource::didAccessDecodedData(MonotonicTime timeStamp)
{
m_lastDecodedAccessTime = timeStamp;
if (allowsCaching() && inCache()) {
auto& memoryCache = MemoryCache::singleton();
if (memoryCache.inLiveDecodedResourcesList(*this)) {
memoryCache.removeFromLiveDecodedResourcesList(*this);
memoryCache.insertInLiveDecodedResourcesList(*this);
}
memoryCache.pruneSoon();
}
}
|