sprig icon indicating copy to clipboard operation
sprig copied to clipboard

chore: remove mitchellh/copystructure dependency

Open TerryHowe opened this issue 3 months ago • 2 comments

Replace dependency on mitchellh/copystructure

Closes: https://github.com/Masterminds/sprig/issues/456

The implementation in github.com/mitchellh/copystructure has many features which we were not using, so I expected and got better performance

go test -bench=. -benchmem ./internal/copystructure/
goos: darwin
goarch: arm64
pkg: helm.sh/helm/v4/internal/copystructure
cpu: Apple M1
BenchmarkInternalCopy-8              	  271351	      4429 ns/op	    5264 B/op	     111 allocs/op
BenchmarkMitchellhCopy-8             	   61238	     19645 ns/op	   15008 B/op	     433 allocs/op
BenchmarkInternalCopyLargeMap-8      	    1364	    889158 ns/op	  808347 B/op	   19022 allocs/op
BenchmarkMitchellhCopyLargeMap-8     	     315	   3784941 ns/op	 2130339 B/op	   75045 allocs/op
BenchmarkInternalCopyDeepNested-8    	   44197	     27205 ns/op	   27648 B/op	     651 allocs/op
BenchmarkMitchellhCopyDeepNested-8   	    5334	    226008 ns/op	   95231 B/op	    2696 allocs/op
PASS

Benchmark that is not included in PR https://gist.github.com/TerryHowe/f53f97016389c6d9cc849f573487d44c

TerryHowe avatar Sep 29 '25 15:09 TerryHowe

Thanks for updating this package! Is there a timeline as to when this change will get merged please?

SanMasood avatar Oct 08 '25 10:10 SanMasood

Ping

TerryHowe avatar Nov 23 '25 15:11 TerryHowe