Skip to content

improve cli startup time #36237

@celesteking

Description

@celesteking

Terraform Version

Terraform v1.9.5-dev
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v5.80.0

Proposal

Something needs to be done in regards to terraform cli startup time. I'm using aws provider which currently weighs 621MB. Even a simple terraform validate on an almost empty project takes 3 seconds over here.
As discussed in Slack, it seems that significant amount of that is taken up by the checksum calculation. I can't even imagine what happens in big projects where several providers are used, with, I guess, would amount to several GBs of monster mono-files.

Looking at strace over here, terraform spends 2.5 seconds between open on that provider and close, between which there are reads of 32K size. I assume that's the hash calculation.
You really really should stop doing the work of the filesystem and the underlying drives to try to safeguard against file corruption. Why is the CRC needed on startup? If you want to protect against accidental provider editing, just check against mtime, but even then, why would you need that? Are you protecting against the version misuse? Name the provider files properly, or pre/suf-fix them with a hash. I don't think there's ambiguity in linux_amd64/terraform-provider-aws_v5.80.0_x5, so why is all this stuff needed at all?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions