go/internal/fastwalk
Charlie Vieth f87c1ed972 internal/fastwalk: improve Darwin performance by ~3x
On darwin/cgo use readdir_r instead of syscall.ReadDirent() since the
later is simulated and slow (see: golang/go#30933).

Unlike CL 392094, this uses CGO instead of "//go:linkname" and assembly.

goos: darwin
goarch: arm64

FastWalk-10    68.9ms ±11%    20.7ms ± 2%  -69.89%  (p=0.008 n=5+5)

name         old alloc/op   new alloc/op   delta
FastWalk-10    1.49MB ± 0%    1.51MB ± 0%   +1.06%  (p=0.008 n=5+5)

name         old allocs/op  new allocs/op  delta
FastWalk-10     32.2k ± 0%     30.7k ± 0%   -4.61%  (p=0.016 n=5+4)

Fixes golang/go#51356

Change-Id: Ia3afd06c8f14bd2036b2a1ea6e3cafbef81d3530
Reviewed-on: https://go-review.googlesource.com/c/tools/+/436780
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-10-13 16:31:57 +00:00
..
fastwalk.go all: gofmt 2022-04-12 17:53:17 +00:00
fastwalk_darwin.go internal/fastwalk: improve Darwin performance by ~3x 2022-10-13 16:31:57 +00:00
fastwalk_dirent_fileno.go all: go fmt ./... 2021-02-20 03:28:52 +00:00
fastwalk_dirent_ino.go internal/fastwalk: improve Darwin performance by ~3x 2022-10-13 16:31:57 +00:00
fastwalk_dirent_namlen_bsd.go internal/fastwalk: improve Darwin performance by ~3x 2022-10-13 16:31:57 +00:00
fastwalk_dirent_namlen_linux.go all: go fmt ./... 2021-02-20 03:28:52 +00:00
fastwalk_portable.go all: go fmt ./... 2021-02-20 03:28:52 +00:00
fastwalk_test.go internal/fastwalk: attempt Symlink tests on Windows 2020-05-21 21:19:27 +00:00
fastwalk_unix.go internal/fastwalk: improve Darwin performance by ~3x 2022-10-13 16:31:57 +00:00