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

Caching on execute_loaders #22

Closed
rochacbruno opened this issue Mar 22, 2017 · 1 comment
Closed

Caching on execute_loaders #22

rochacbruno opened this issue Mar 22, 2017 · 1 comment

Comments

@rochacbruno
Copy link
Member

Currently, all loaders are executed again every time we

  • switch namespaces using settings.using_namespace or settings.namespace
  • when a variable is marked as always_fresh
  • when using `settings.get('var', fresh=True)

For the fresh=True and always_fresh it makes sense to execute loaders again as it is demanded to get the fresh variable (lets say from redis or another database).

The problem is that it may cause overhead (I guess not too much) but in any case we can improve by.

  • writing more namespace tests (with more switching and fresh examples)
  • implement a cache on execute_loaders so files and databases are not accessed twice when we are only switching namespaces and not wanting to load all again.

Part of this is already implemented in loaded_by_loaders dictionary, we just need to use this as a cache point.

@rochacbruno
Copy link
Member Author

Closing as this is a no-issue

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

No branches or pull requests

1 participant