-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Description
I noticed that I have 22,896 duplicate files in my GOMODCACHE looking only at candidates that are at the same relative path within in the same module name, but just at different versions.
In other words, many files in a module don't change between versions, say, 1.0.0 and 1.0.1.
Maybe go mod download could do clonefile (macOS, APFS, cp -c) or FICLONE (Linux, XFS/btfs/etc, cp --reflink) to save disk space when possible?
The search doesn't cost much: you don't need to sha256 all files in GOMODCACHE looking for dups. Just looking at same relative path in other versions of the same module gets almost all of the win.
And then you can detect files already sharing backing storage with F_CTNL F_LOG2PHYS_EXT on macOS or fiemap on Linux.
mateusz834 and adonovan
Metadata
Metadata
Assignees
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.ToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.