Title: [137001] trunk/Source/_javascript_Core
Revision
137001
Author
[email protected]
Date
2012-12-07 17:00:16 -0800 (Fri, 07 Dec 2012)

Log Message

Make function code cache proportional to main codeblock cache
https://bugs.webkit.org/show_bug.cgi?id=104420

Reviewed by Geoffrey Garen.

Makes the constants determining the recently used function cache proportional
to the number of root codeblocks in the cache.  Also renames the constants to
make them more clear.

* runtime/CodeCache.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (137000 => 137001)


--- trunk/Source/_javascript_Core/ChangeLog	2012-12-08 00:42:39 UTC (rev 137000)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-12-08 01:00:16 UTC (rev 137001)
@@ -1,3 +1,16 @@
+2012-12-07  Oliver Hunt  <[email protected]>
+
+        Make function code cache proportional to main codeblock cache
+        https://bugs.webkit.org/show_bug.cgi?id=104420
+
+        Reviewed by Geoffrey Garen.
+
+        Makes the constants determining the recently used function cache proportional
+        to the number of root codeblocks in the cache.  Also renames the constants to
+        make them more clear.
+     
+        * runtime/CodeCache.h:
+
 2012-12-06  Filip Pizlo  <[email protected]>
 
         Strange results calculating a square root in a loop

Modified: trunk/Source/_javascript_Core/runtime/CodeCache.h (137000 => 137001)


--- trunk/Source/_javascript_Core/runtime/CodeCache.h	2012-12-08 00:42:39 UTC (rev 137000)
+++ trunk/Source/_javascript_Core/runtime/CodeCache.h	2012-12-08 01:00:16 UTC (rev 137001)
@@ -131,12 +131,18 @@
     GlobalFunctionKey makeGlobalFunctionKey(const SourceCode&, const String&);
 
     enum {
-        kMaxCodeBlockEntries = 1024,
+        kMaxRootCodeBlockEntries = 1024,
         kMaxGlobalFunctionEntries = 1024,
-        kMaxFunctionCodeBlocks = 1024
+        // Sampling content on a number of sites indicates that
+        // on average there are 6-7 functions used per root codeblock.
+        // So we'll allow an average of 8 to give some leeway for increasing
+        // page complexity over time. Note that is simply a probabalistic
+        // measure and does not result in a hard limit of cache entries
+        // in each code block.
+        kMaxFunctionCodeBlocks = kMaxRootCodeBlockEntries * 8
     };
 
-    CacheMap<CodeBlockKey, Strong<UnlinkedCodeBlock>, kMaxCodeBlockEntries> m_cachedCodeBlocks;
+    CacheMap<CodeBlockKey, Strong<UnlinkedCodeBlock>, kMaxRootCodeBlockEntries> m_cachedCodeBlocks;
     CacheMap<GlobalFunctionKey, Strong<UnlinkedFunctionExecutable>, kMaxFunctionCodeBlocks> m_cachedGlobalFunctions;
     CacheMap<UnlinkedFunctionCodeBlock*, Strong<UnlinkedFunctionCodeBlock>, kMaxFunctionCodeBlocks> m_recentlyUsedFunctionCode;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to