Summary: | createFontFaceValue() should be smarter about overgrown cache. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||
Component: | CSS | Assignee: | Andreas Kling <kling> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, esprehn+autocc, glenn, gyuyoung.kim, kling, macpherson, menard | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Andreas Kling
2013-11-01 15:40:45 PDT
Created attachment 215770 [details]
Patch
Comment on attachment 215770 [details]
Patch
Does this make something faster?
Comment on attachment 215770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=215770&action=review > Source/WebCore/css/CSSValuePool.cpp:132 > - // Just wipe out the cache and start rebuilding if it gets too big. > + // Remove one entry at random if the cache grows too large. > const int maximumFontFaceCacheSize = 128; > - if (m_fontFaceValueCache.size() > maximumFontFaceCacheSize) > - m_fontFaceValueCache.clear(); > + if (m_fontFaceValueCache.size() + 1 >= maximumFontFaceCacheSize) This check is kind of strange. It lets the cache grow to a size of 127. After the add call below the cache might be one bigger or might not. If the cache already has 127, then it will remove one and then add one and get back to 127. So calling 128 the maximum is then silly. I would consider either size >= maximum or size + 1 > maximum to be more sensible. Committed r158478: <http://trac.webkit.org/changeset/158478> |