[pypy-svn] pypy default: Improve arbitrary limit of cache size on OS X

fijal commits-noreply at bitbucket.org
Mon Mar 14 00:40:30 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r42582:2f5ddc612b7d
Date: 2011-03-13 18:57 -0400
http://bitbucket.org/pypy/pypy/changeset/2f5ddc612b7d/

Log:	Improve arbitrary limit of cache size on OS X

diff --git a/pypy/rpython/memory/gc/minimark.py b/pypy/rpython/memory/gc/minimark.py
--- a/pypy/rpython/memory/gc/minimark.py
+++ b/pypy/rpython/memory/gc/minimark.py
@@ -115,7 +115,6 @@
                               ('forw', llmemory.Address))
 FORWARDSTUBPTR = lltype.Ptr(FORWARDSTUB)
 
-
 # ____________________________________________________________
 
 class MiniMarkGC(MovingGCBase):

diff --git a/pypy/rpython/memory/gc/env.py b/pypy/rpython/memory/gc/env.py
--- a/pypy/rpython/memory/gc/env.py
+++ b/pypy/rpython/memory/gc/env.py
@@ -233,13 +233,17 @@
 get_L2cache = globals().get('get_L2cache_' + sys.platform,
                             lambda: -1)     # implement me for other platforms
 
+NURSERY_SIZE_UNKNOWN_CACHE = 1024*1024*1024
+# arbitrary 1M. better than default of 131k for most cases
+# in case it didn't work
+
 def best_nursery_size_for_L2cache(L2cache):
     # Heuristically, the best nursery size to choose is about half
     # of the L2 cache.
     if L2cache > 0:
         return L2cache // 2
     else:
-        return -1
+        return NURSERY_SIZE_UNKNOWN_CACHE
 
 def estimate_best_nursery_size():
     """Try to estimate the best nursery size at run-time, depending


More information about the Pypy-commit mailing list