Clearing the whole cache when it hits the size limit is silly.
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>