Skip to content

Commit

Permalink
Merge pull request #336 from cloudfoundry/pgzip
Browse files Browse the repository at this point in the history
Use multi-core optimized pgzip package in tarball (de)compression
  • Loading branch information
jpalermo authored Nov 21, 2024
2 parents 50ebcd5 + fd5815a commit 5d47a92
Show file tree
Hide file tree
Showing 45 changed files with 5,863 additions and 4 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/golang/mock v1.6.0
github.com/google/uuid v1.6.0
github.com/kevinburke/ssh_config v1.2.0
github.com/klauspost/pgzip v1.2.6
github.com/masterzen/winrm v0.0.0-20240702205601-3fad6e106085
github.com/maxbrunsfeld/counterfeiter/v6 v6.9.0
github.com/mitchellh/mapstructure v1.5.0
Expand All @@ -27,6 +28,7 @@ require (
github.com/opencontainers/runtime-spec v1.2.0
github.com/pivotal/go-smtpd v0.0.0-20140108210614-0af6982457e5
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.29.0
golang.org/x/net v0.31.0
Expand Down Expand Up @@ -68,7 +70,6 @@ require (
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down
7 changes: 4 additions & 3 deletions releasetarball/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"bufio"
"bytes"
"cmp"
"compress/gzip"
"errors"
"fmt"
"io"
Expand All @@ -26,6 +25,8 @@ import (
"strings"
"time"

"github.com/klauspost/pgzip"

"gopkg.in/yaml.v3"

"code.cloudfoundry.org/clock"
Expand Down Expand Up @@ -220,7 +221,7 @@ func writeCompiledRelease(m manifest.Manifest, outputDirectory, stemcellFilename
return "", err
}
defer closeAndIgnoreErr(outputFile)
gw := gzip.NewWriter(outputFile)
gw := pgzip.NewWriter(outputFile)
defer closeAndIgnoreErr(gw)
tw := tar.NewWriter(gw)
defer closeAndIgnoreErr(tw)
Expand Down Expand Up @@ -320,7 +321,7 @@ func walkTarballFiles(releaseFilePath string, file tarballWalkFunc) error {
return nil
}
defer closeAndIgnoreErr(f)
gr, err := gzip.NewReader(bufio.NewReader(f))
gr, err := pgzip.NewReader(bufio.NewReader(f))
if err != nil {
return err
}
Expand Down
7 changes: 7 additions & 0 deletions vendor/github.com/onsi/ginkgo/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions vendor/github.com/onsi/ginkgo/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5d47a92

Please sign in to comment.