You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apart from fixing len(recently_created) at compile-time this may well be a good idea. Main objections:
It will make debugging that much harder. Given that doctests are small, the parent deletion code will hardly be exercised.
Do we have good use-cases that show clear benefit from this approach? Given that the frequency of garbage collection in python is rather low, I'd expect that parents will relatively often still be around if they are required soon after deletion.
Apart from fixing len(recently_created) at compile-time this may well be a good idea.
len(list) is really fast, much faster than creating a parent, and allows our list to possibly grow or shrink in the future.
Main objections:
It will make debugging that much harder. Given that doctests are small, the parent deletion code will hardly be exercised.
Do we have good use-cases that show clear benefit from this approach? Given that the frequency of garbage collection in python is rather low, I'd expect that parents will relatively often still be around if they are required soon after deletion.
I actually agree with both of these objections; I don't think this code should go in unless it's clearly shown to be a problem.
Cache a bounded number of recently-created parents to avoid repeated re-creation when strong references are not kept.
Related: #715, #14072, #14058.
CC: @nbruin @simon-king-jena @jpflori
Component: memleak
Author: Robert Bradshaw
Issue created by migration from https://trac.sagemath.org/ticket/14073
The text was updated successfully, but these errors were encountered: