Skip to content

Conversation

@Gofastasf
Copy link
Contributor

filepath.Walk calls os.Lstat for every file or directory to retrieve os.FileInfo, which can be slower.

filepath.WalkDir avoids unnecessary system calls since it provides a fs.DirEntry, which includes file type information without requiring a stat call.

filepath.Walk calls os.Lstat for every file or directory to retrieve os.FileInfo, which can be slower. filepath.WalkDir avoids unnecessary system calls since it provides a fs.DirEntry, which includes file type information without requiring a stat call.
@Gofastasf Gofastasf requested a review from a team as a code owner January 17, 2025 14:33
@Gofastasf
Copy link
Contributor Author

@lucix-aws hey thanks. Is it ready to get merged ?

@lucix-aws lucix-aws merged commit 613a6cf into aws:main Jan 23, 2025
11 of 13 checks passed
@Gofastasf Gofastasf deleted the optimize/directory-traversal branch January 24, 2025 02:27
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