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

jsonplan: Improve performance for deep objects #30561

Merged
merged 1 commit into from
Feb 22, 2022

Commits on Feb 18, 2022

  1. jsonplan: Improve performance for deep objects

    When calculating the unknown values for JSON plan output, we would
    previously recursively call the `unknownAsBool` function on the current
    sub-tree twice, if any values were unknown. This was wasteful, but not
    noticeable for normal Terraform resource shapes.
    
    However for deeper nested object values, such as Kubernetes manifests,
    this was a severe performance problem, causing `terraform show -json` to
    take several hours to render a plan.
    
    This commit reuses the already calculated unknown value for the subtree,
    and adds benchmark coverage to demonstrate the improvement.
    alisdair committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    3e4d6b2 View commit details
    Browse the repository at this point in the history