8000 Tags · kvey/skaffold · GitHub
[go: up one dir, main page]

Skip to content

Tags

Tags

v2.24.0-serval.1

Toggle v2.24.0-serval.1's commit message

Unverified

No user is associated with the committer email.
perf(helm): reuse the post-renderer plugin and helm version across a run

Two pieces of per-call work that are invariant for the lifetime of the process,
and are paid once per RELEASE on the deploy path and once per CONFIG on the
render path.

1. The Helm v4 post-renderer plugin (PreparePostRenderer)

   The generated plugin manifest depends only on the Skaffold binary path.
   Everything that varies per release — labels, image replacements, debug
   settings, kubeconfig — travels in SKAFFOLD_CMDLINE at `helm template` /
   `helm install` invocation time, not in the manifest. So the plugin installed
   for release N is byte-identical to the one installed for release N+1, modulo
   its randomly generated name.

   It is now installed once, keyed on the Skaffold binary, and removed by
   CleanupSharedPostRenderer at process shutdown rather than by each caller's
   defer. A different binary still forces a reinstall.

   Note this only affects Helm >= 4.0.0-beta.1. On Helm v3 Skaffold passes
   `--post-renderer <executable>` and installs no plugin at all, which is why
   the cost is invisible to most users.

2. `helm version` (BinVer)

   The helm binary on PATH cannot change mid-run. Memoized.

Measured on a 21-config, 21-release monorepo (`skaffold render`, warm caches,
alternating A/B against the same commit, 6 runs each, machine at load ~9):

  helm subprocesses   107 -> 45   (plugin 42 -> 2, version 23 -> 1)
  wall clock          33.63s -> 19.61s   (-14.0s, -42%)

The two distributions do not overlap: base ranged 32.01-35.21s, patched
19.03-20.70s. Rendered output is byte-identical (179484 bytes) before and after.

Both caches are process-wide, so tests that assert on the executed command
sequence must clear them; ResetSharedPostRendererForTest and
ResetBinVerCacheForTest exist for that and are wired into the affected tests.

For upstreaming this is cleanly separable into the two changes above.
0