sysfont icon indicating copy to clipboard operation
sysfont copied to clipboard

Use optimized filepath.WalkDir function instead of filepath.Walk

Open hismailbulut opened this issue 3 years ago • 1 comments

A simple test shows the performance difference

Test with filepath.Walk: goos: windows goarch: amd64 pkg: github.com/adrg/sysfont cpu: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz BenchmarkNewFinder-4 3 466802100 ns/op PASS ok github.com/adrg/sysfont 2.978s

Test with filepath.WalkDir: goos: windows goarch: amd64 pkg: github.com/adrg/sysfont cpu: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz BenchmarkNewFinder-4 3 427294700 ns/op PASS ok github.com/adrg/sysfont 2.743s

hismailbulut avatar Oct 09 '21 21:10 hismailbulut

Hi @hismailbulut. Thank you for the PR. I would love to adopt this change at this point. However filepath.WalkDir was introduced in Go v1.16 (which was just released on February 16, 2021).

That means that I would force the Go v1.16 restriction on all packages already using this one in future releases. I'll most certainly transition to filepath.WalkDir in the future, but I think it's a bit too soon right now.

adrg avatar Oct 10 '21 06:10 adrg