Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use optimized filepath.WalkDir function instead of filepath.Walk #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hismailbulut
Copy link

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

@adrg
Copy link
Owner

adrg commented Oct 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants