Martin v. Löwis <martin <at> v.loewis.de> writes: > Currently, only youngest collections are triggered by allocation > rate; middle and old are triggered by frequency of youngest collection. > So would you now specify that the youngest collection should occur > if-and-only-if a new arena is allocated? Or discount arenas returned > from arenas allocated?
The latter sounds reasonable. IIRC an arena is 256KB, which is less than an entry level L2 cache. Therefore waiting for an arena to be filled shouldn't deteriorate cache locality a lot. To avoid situations where the GC is never called we could combine that with an allocation counter, but with a much higher threshold than currently. > Or apply this to triggering other generation > collections but youngest? How would that help the quadratic behavior > (which really needs to apply a factor somewhere)? It would not help the quadratic behaviour - and is orthogonal to your proposal - , but at least avoid calling the GC too often when lots of small objects are allocated (as opposed to lots of large objects). _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com