Antoine Pitrou <solipsis <at> pitrou.net> writes: > > We could let the user configure the threshold between the old policy and the new > policy. Currently it is hard-wired to a value of 10000 (that is, 10000 > long-lived objects tracked by the GC). I've removed the threshold in the latest patches because it didn't make much sense when a few long-lived objects contained a lot of objects not tracked by the GC. Another improvement I've included in the latest patches (but which is orthogonal to the algorithmic change) is that simple tuples and even simple dicts are not tracked by the GC if they don't need to. A few examples (gc.is_tracked() is a new function which returns True if an object is tracked by the GC): >>> import gc >>> gc.is_tracked(()) False >>> gc.is_tracked((1,2)) False >>> gc.is_tracked((1,(2, "a", None))) False >>> gc.is_tracked((1,(2, "a", None, {}))) True >>> d = {} >>> gc.is_tracked(d) False >>> d[1,2] = 3,4 >>> gc.is_tracked(d) False >>> d[5] = None, "a", (1,2,3) >>> gc.is_tracked(d) False >>> d[6] = {} >>> gc.is_tracked(d) True >>> gc.is_tracked(d[6]) False Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4