1. Olemis Lang
  2. pypy


Maciej Fijalkowski  committed d552e0f

it turns out my laptop has 3M of cache and the default of 4M is a bad idea

  • Participants
  • Parent commits 5e70f59
  • Branches default

Comments (0)

Files changed (2)

File rpython/memory/gc/env.py

View file
 def best_nursery_size_for_L2cache(L2cache):
     # Heuristically, the best nursery size to choose is about half
     # of the L2 cache.
-    if L2cache > 0:
+    if L2cache > 1024 * 1024: # we don't want to have nursery estimated
+        # on L2 when L3 is present
         return L2cache // 2

File rpython/memory/gc/minimark.py

View file
             # size (needed to handle mallocs just below 'large_objects') but
             # hacking at the current nursery position in collect_and_reserve().
             if newsize <= 0:
-                newsize = 4*1024*1024   # fixed to 4MB by default
+                newsize = env.estimate_best_nursery_size()
+                #         4*1024*1024   # fixed to 4MB by default
                 #        (it was env.estimate_best_nursery_size())
                 if newsize <= 0:
                     newsize = defaultsize
         """To call when nursery_free overflows nursery_top.
         First check if the nursery_top is the real top, otherwise we
         can just move the top of one cleanup and continue
         Do a minor collection, and possibly also a major collection,
         and finally reserve 'totalsize' bytes at the start of the
         now-empty nursery.