Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache a bounded number of recently-created parents. #14073

Open
robertwb opened this issue Feb 6, 2013 · 3 comments
Open

Cache a bounded number of recently-created parents. #14073

robertwb opened this issue Feb 6, 2013 · 3 comments

Comments

@robertwb
Copy link
Contributor

robertwb commented Feb 6, 2013

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

@robertwb robertwb added this to the sage-5.11 milestone Feb 6, 2013
@simon-king-jena
Copy link
Member

comment:1

Attachment: 14073-recently-created.patch.gz

Yep, that's about what I thought would work.

@nbruin
Copy link
Contributor

nbruin commented Feb 7, 2013

comment:2

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.

@robertwb
Copy link
Contributor Author

robertwb commented Feb 7, 2013

comment:3

Replying to @nbruin:

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.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants