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

Proposal: Automatic caching of condition functions #125

Open
csadorf opened this issue Jul 12, 2019 · 5 comments
Open

Proposal: Automatic caching of condition functions #125

csadorf opened this issue Jul 12, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@csadorf
Copy link
Contributor

csadorf commented Jul 12, 2019

Feature description

We are currently operating under the assumption that the project data space does not change while we are gathering the project status.

We should take advantage of that assumption and automatically cache all condition functions.

Proposed solution

Caching should be done on a per-instance level, but should be parallelizable.

@vyasr
Copy link
Contributor

vyasr commented Feb 26, 2020

@csadorf what was your idea here? Is the idea that if a given condition function decorates multiple operations, then we could reuse cached results? We still definitely need to start from scratch again every time that _fetch_status is called, right?

@csadorf
Copy link
Contributor Author

csadorf commented Feb 27, 2020

Yes, the same condition function is evaluated potentially many times during one status update. That could be automatically cashed. I think that we assume "no changes" to the data space during _fetch_status() so that would be the appropriate scope.

@b-butler
Copy link
Member

b-butler commented Mar 3, 2020

In addition, often labels are used as condition functions. This would prevent the calculating of labels more than once as well.

@vyasr
Copy link
Contributor

vyasr commented Mar 4, 2020

I think that various internal variables are named somewhat ambiguously because in earlier versions of signac there was less conceptual separation between labels and conditions (basically before the decorator syntax). If we were to handle this with respect to both labels and conditions, it would probably be helpful to clearly separate these two objects in the code.

@b-butler
Copy link
Member

b-butler commented Mar 5, 2020

We could definitely do that, but to see the most performance gains we would need to identify both conditions and labels by some means that would tell us when the underlying function is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants