• Alex Brainman's avatar
    os: avoid calulating fileStat.path until it is needed · 6dcaa095
    Alex Brainman authored
    This CL improves
    
    on my Windows 7
    
    name         old time/op    new time/op    delta
    Readdirname    58.1µs ± 1%    58.1µs ± 0%     ~     (p=0.817 n=8+8)
    Readdir        58.0µs ± 3%    57.8µs ± 0%     ~     (p=0.944 n=9+8)
    
    name         old alloc/op   new alloc/op   delta
    Readdirname    3.03kB ± 0%    2.84kB ± 0%   -6.33%  (p=0.000 n=10+10)
    Readdir        3.00kB ± 0%    2.81kB ± 0%   -6.40%  (p=0.000 n=10+10)
    
    name         old allocs/op  new allocs/op  delta
    Readdirname      34.0 ± 0%      30.0 ± 0%  -11.76%  (p=0.000 n=10+10)
    Readdir          33.0 ± 0%      29.0 ± 0%  -12.12%  (p=0.000 n=10+10)
    
    on my Windows XP
    
    name           old time/op    new time/op    delta
    Readdirname-2    85.5µs ± 0%    84.0µs ± 0%   -1.83%  (p=0.000 n=10+10)
    Readdir-2        84.6µs ± 0%    83.5µs ± 0%   -1.31%  (p=0.000 n=10+9)
    
    name           old alloc/op   new alloc/op   delta
    Readdirname-2    6.52kB ± 0%    5.66kB ± 0%  -13.25%  (p=0.000 n=10+10)
    Readdir-2        6.39kB ± 0%    5.53kB ± 0%  -13.52%  (p=0.000 n=10+10)
    
    name           old allocs/op  new allocs/op  delta
    Readdirname-2      78.0 ± 0%      66.0 ± 0%  -15.38%  (p=0.000 n=10+10)
    Readdir-2          77.0 ± 0%      65.0 ± 0%  -15.58%  (p=0.000 n=10+10)
    
    Change-Id: I5d698eca86b8e94a46b6cfbd5947898b7b3fbdbd
    Reviewed-on: https://go-review.googlesource.com/42894Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    6dcaa095
Name
Last commit
Last update
..
exec Loading commit data...
signal Loading commit data...
user Loading commit data...
dir.go Loading commit data...
dir_plan9.go Loading commit data...
dir_unix.go Loading commit data...
dir_windows.go Loading commit data...
env.go Loading commit data...
env_test.go Loading commit data...
env_unix_test.go Loading commit data...
error.go Loading commit data...
error_plan9.go Loading commit data...
error_posix.go Loading commit data...
error_test.go Loading commit data...
error_unix.go Loading commit data...
error_unix_test.go Loading commit data...
error_windows.go Loading commit data...
error_windows_test.go Loading commit data...
example_test.go Loading commit data...
exec.go Loading commit data...
exec_plan9.go Loading commit data...
exec_posix.go Loading commit data...
exec_unix.go Loading commit data...
exec_windows.go Loading commit data...
executable.go Loading commit data...
executable_darwin.go Loading commit data...
executable_freebsd.go Loading commit data...
executable_plan9.go Loading commit data...
executable_procfs.go Loading commit data...
executable_solaris.go Loading commit data...
executable_test.go Loading commit data...
executable_windows.go Loading commit data...
export_test.go Loading commit data...
export_windows_test.go Loading commit data...
file.go Loading commit data...
file_plan9.go Loading commit data...
file_posix.go Loading commit data...
file_unix.go Loading commit data...
file_windows.go Loading commit data...
getwd.go Loading commit data...
getwd_darwin.go Loading commit data...
os_test.go Loading commit data...
os_unix_test.go Loading commit data...
os_windows_test.go Loading commit data...
path.go Loading commit data...
path_plan9.go Loading commit data...
path_test.go Loading commit data...
path_unix.go Loading commit data...
path_windows.go Loading commit data...
path_windows_test.go Loading commit data...
pipe_bsd.go Loading commit data...
pipe_freebsd.go Loading commit data...
pipe_linux.go Loading commit data...
pipe_test.go Loading commit data...
proc.go Loading commit data...
stat_darwin.go Loading commit data...
stat_dragonfly.go Loading commit data...
stat_freebsd.go Loading commit data...
stat_linux.go Loading commit data...
stat_nacl.go Loading commit data...
stat_netbsd.go Loading commit data...
stat_openbsd.go Loading commit data...
stat_plan9.go Loading commit data...
stat_solaris.go Loading commit data...
stat_unix.go Loading commit data...
stat_windows.go Loading commit data...
sticky_bsd.go Loading commit data...
sticky_notbsd.go Loading commit data...
str.go Loading commit data...
sys.go Loading commit data...
sys_bsd.go Loading commit data...
sys_darwin.go Loading commit data...
sys_freebsd.go Loading commit data...
sys_linux.go Loading commit data...
sys_nacl.go Loading commit data...
sys_plan9.go Loading commit data...
sys_solaris.go Loading commit data...
sys_unix.go Loading commit data...
sys_windows.go Loading commit data...
types.go Loading commit data...
types_plan9.go Loading commit data...
types_unix.go Loading commit data...
types_windows.go Loading commit data...
wait_unimp.go Loading commit data...
wait_wait6.go Loading commit data...
wait_waitid.go Loading commit data...