helmfile/pkg/helmexec
Indrek Juhkam a409b450cd
Add `--skip-refresh` flag to the build command (#444)
This improves the `helmfile sync` performance.

From the code: `BuildDeps` is used only by `runHelmDepBuilds`, which
only is used by `PrepareCharts` which is finally only used by
`withPreparedCharts`.

`withPreparedCharts` already does `SyncReposOnce` which means we do not
have to refresh the local repository cache on each chart build.

This is only supported in Helm v3.

This seems to be mostly affecting helmfiles which have a lot of releases
and those release charts use sub dependencies.

I saw significant performance improvements for a helmfile with 45
releases, 2 repositories, and most of the charts also had their own
dependencies. Results:

Before the patch:
* real  9m10.565s
* real  9m38.335s
* real  9m14.941s
* real  5m13.106s (with cache)

After the patch:
* real  6m51.965s
* real  6m36.605s
* real  6m31.685s
* real  3m0.271s (with cache)

These were tested with:
```
rm -rf ~/.cache/helmfile ~/.cache/helm ~/.config/helm/repositories.* && helmfile sync ...
```

The result with `(with cache)` was without deleting the caches first.

From these metrics it seems that the sync duration decreased 20-45%
depending on the run, release count, dependencies and if the cache was
used or not.

As far as I understand, this should be backward-compatible change.

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>
2022-10-20 09:03:08 +09:00
..
context.go add Go lint 2022-07-16 20:21:11 +08:00
context_test.go add Go lint 2022-07-16 20:21:11 +08:00
exec.go Add `--skip-refresh` flag to the build command (#444) 2022-10-20 09:03:08 +09:00
exec_test.go Add `--skip-refresh` flag to the build command (#444) 2022-10-20 09:03:08 +09:00
exit_error.go fix: Do not include stderr content in result of `{{ exec }}` (#1298) 2020-06-06 09:29:12 +09:00
helmexec.go Use helm show chart to identify chart version 2022-10-03 22:04:08 -03:00
id.go Print command output in line (#1354) 2020-08-29 14:47:22 +09:00
id_test.go Add unittest for newExecutionID 2022-04-24 13:55:28 +08:00
log.go add Go lint 2022-07-16 20:21:11 +08:00
runner.go feat: show live output from the Helm binary (#286) 2022-09-18 14:24:35 +09:00
runner_test.go feat: show live output from the Helm binary (#286) 2022-09-18 14:24:35 +09:00