Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Fix PR comments
  • Loading branch information
mafredri committed Jun 20, 2022
commit 0c6e367b0924e7c43c22bffa51cb486cf46782aa
9 changes: 5 additions & 4 deletions site/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,14 @@ func filterFiles(files []fs.DirEntry, names ...string) []fs.DirEntry {
return filtered
}

func extractBin(dest string, r io.Reader) (n int, err error) {
func extractBin(dest string, r io.Reader) (numExtraced int, err error) {
opts := []zstd.DOption{
// Concurrency doesn't help us when decoding the tar and
// can actually slow us down.
zstd.WithDecoderConcurrency(1),
// Ignoring checksums give us a slight performance
// increase, we assume no corruption due to embedding.
zstd.IgnoreChecksum(true),
// Ignoring checksums can give a slight performance
// boost but it's probalby not worth the reduced safety.
zstd.IgnoreChecksum(false),
// Allow the decoder to use more memory giving us a 2-3x
// performance boost.
zstd.WithDecoderLowmem(false),
Expand All @@ -480,6 +480,7 @@ func extractBin(dest string, r io.Reader) (n int, err error) {
defer zr.Close()

tr := tar.NewReader(zr)
n := 0
for {
h, err := tr.Next()
if err != nil {
Expand Down