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

Feature request: Allow all vars to be reset in an existing VM #499

Open
gotwarlost opened this issue Jan 13, 2021 · 1 comment
Open

Feature request: Allow all vars to be reset in an existing VM #499

gotwarlost opened this issue Jan 13, 2021 · 1 comment

Comments

@gotwarlost
Copy link
Contributor

Based on the comment @sbarzowski made in a different conversation that only the value cache of a VM is affected when variables are changed but not the import AST cache, it led me to think that maybe qbec should be re-using VMs from a pool and not creating them on demand such that existing import caches in the VMs created can provide performance boosts.

For this to work I need a way to clear all variables (TLAs, extvars etc.) since the set of variables is not consistent across VM use. Currently, I think there is no way to do this. Probably a method like ResetVars() on the VM instance which blanks out the exts, tlas and nukes the value cache.

Happy to provide a PR if this makes sense.

@sbarzowski
Copy link
Collaborator

Yes, it makes sense.

Right now you can add/override previously added ones, but not delete them. So yeah, functions to reset them would be nice. I would go with separate functions for reseting tlas and extvars, because they have different cache policies and can be used differently.

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

2 participants