go/src/os
Taru Karttunen f5f480e1df os: reduce allocations in Readdir on unix
Include syscall.Stat_t on unix to the
unexported fileStat structure rather than
accessing it though an interface.

Additionally add a benchmark for Readdir
(and Readdirnames).

Tested on linux, freebsd, netbsd, openbsd
darwin, solaris, does not touch windows
stuff. Does not change the API, as
discussed on golang-dev.

E.g. on linux/amd64 with a directory of 65 files:

benchmark              old ns/op     new ns/op     delta
BenchmarkReaddir-4     67774         66225         -2.29%

benchmark              old allocs     new allocs     delta
BenchmarkReaddir-4     334            269            -19.46%

benchmark              old bytes     new bytes     delta
BenchmarkReaddir-4     25208         24168         -4.13%

Change-Id: I44ef72a04ad7055523a980f29aa11122040ae8fe
Reviewed-on: https://go-review.googlesource.com/16423
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-30 19:47:55 +00:00
..
exec os/exec: make Cmd.Output include stderr in ExitError 2015-10-22 14:08:10 +00:00
signal os/signal: don't expect to be notified for os.Kill 2015-10-29 15:39:15 +00:00
user os/user: don't depend on _SC_GETPW_R_SIZE_MAX on Linux 2015-08-21 04:23:15 +00:00
dir_plan9.go
dir_unix.go os: do not assume syscall i/o funcs return n=0 on error 2014-10-28 15:00:13 -04:00
dir_windows.go
doc.go
env.go os: add LookupEnv, like Getenv but reports presence 2015-05-05 21:05:12 +00:00
env_test.go os: eradicate smallpox after test 2015-05-06 17:38:57 +00:00
env_unix_test.go
error.go
error_plan9.go os: make IsPermission, IsExist, and IsNotExist unwrap SyscallError too 2015-10-10 21:20:14 +00:00
error_test.go os: make IsPermission, IsExist, and IsNotExist unwrap SyscallError too 2015-10-10 21:20:14 +00:00
error_unix.go os: make IsPermission, IsExist, and IsNotExist unwrap SyscallError too 2015-10-10 21:20:14 +00:00
error_windows.go os: make IsPermission, IsExist, and IsNotExist unwrap SyscallError too 2015-10-10 21:20:14 +00:00
exec.go os: fix a race between Process.signal() and wait() on Windows 2015-06-11 01:33:25 +00:00
exec_plan9.go
exec_posix.go os: replace itod on posix with general itoa and fix possible infinite recursion 2015-01-02 16:21:18 +00:00
exec_unix.go
exec_windows.go os: fix a race between Process.signal() and wait() on Windows 2015-06-11 01:33:25 +00:00
export_test.go
file.go os: document that behavior of Seek on O_APPEND files is not specified 2015-09-23 17:06:02 +00:00
file_plan9.go os: remove stuttering return value names 2015-07-18 01:34:21 +00:00
file_posix.go os: remove stuttering return value names 2015-07-18 01:34:21 +00:00
file_unix.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
file_windows.go os: remove stuttering return value names 2015-07-18 01:34:21 +00:00
getwd.go
getwd_darwin.go
os_test.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
os_unix_test.go os: add explicit tests for fchown(2) and lchown(2) on unix platforms 2015-07-31 19:41:42 +00:00
os_windows_test.go os: add check for ERROR_BAD_NETPATH in windows IsNotExist 2015-09-23 04:51:45 +00:00
path.go
path_plan9.go all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
path_test.go os: disable symlink tests on android. 2015-10-20 22:18:23 +00:00
path_unix.go all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
path_windows.go all: use "reports whether" in place of "returns true if(f)" 2015-03-18 15:14:06 +00:00
pipe_bsd.go
pipe_linux.go
proc.go os: give race detector chance to override Exit(0) 2015-03-28 12:42:37 +00:00
stat_darwin.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_dragonfly.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_freebsd.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_linux.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_nacl.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_netbsd.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_openbsd.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_plan9.go os: remove stuttering return value names 2015-07-18 01:34:21 +00:00
stat_solaris.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
stat_windows.go os: remove stuttering return value names 2015-07-18 01:34:21 +00:00
sticky_bsd.go os: handle the sticky bit separately for *BSD and Solaris 2014-12-17 16:07:28 +00:00
sticky_notbsd.go os: handle the sticky bit separately for *BSD and Solaris 2014-12-17 16:07:28 +00:00
str.go os: replace itod on posix with general itoa and fix possible infinite recursion 2015-01-02 16:21:18 +00:00
sys_bsd.go
sys_darwin.go
sys_freebsd.go
sys_linux.go
sys_nacl.go
sys_plan9.go
sys_solaris.go
sys_unix.go
sys_windows.go os: Use GetComputerNameEx to get Hostname on win32 2015-02-25 23:16:44 +00:00
types.go os: clarify that ModePerm permission bits are the Unix ones 2015-04-16 16:42:10 +00:00
types_plan9.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
types_unix.go os: reduce allocations in Readdir on unix 2015-10-30 19:47:55 +00:00
types_windows.go