google / google/go-jsonnet

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

Open
#499 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
1.8k
Forks
263
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.