• Richard Miller's avatar
    syscall: reduce redundant getwd tracking in Plan 9 · a379b7d9
    Richard Miller authored
    In Plan 9, each M is implemented as a separate OS process with
    its own working directory.  To keep the wd consistent across
    goroutines (or rescheduling of the same goroutine), CL 6350
    introduced a Fixwd procedure which checks using getwd and calls
    chdir if necessary before any syscall operating on a pathname.
    
    This wd checking will not be necessary if the pathname is absolute
    (starts with '/' or '#').  Getwd is a fairly expensive operation
    in Plan 9 (implemented by opening "." and calling Fd2path on the
    file descriptor).  Eliminating the redundant getwd calls can
    significantly reduce overhead for common operations like
    "dist test --list" which perform many syscalls on absolute pathnames.
    
    Updates #9428.
    
    Change-Id: I13fd9380779de27b0ac2f2b488229778d6839255
    Reviewed-on: https://go-review.googlesource.com/97675Reviewed-by: 's avatarDavid du Colombier <0intro@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: David du Colombier <0intro@gmail.com>
    a379b7d9
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...