internal/pkg: buffer tar reader

This significantly improves performance and is a good assumption since the primary use case of FileArtifact is over the network.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-02-11 02:08:44 +09:00
parent de06ea2be4
commit dbb89dfb0f

View File

@@ -114,7 +114,9 @@ func (a *tarArtifact) Cure(t *TContext) (err error) {
err = closeErr
}
}(tr)
tr = io.NopCloser(tr)
br := t.cache.getReader(tr)
defer t.cache.putReader(br)
tr = io.NopCloser(br)
switch a.compression {
case TarUncompressed: