diff options
author | Daniel Martí <mvdan@mvdan.cc> | 2019-03-03 23:52:00 +0000 |
---|---|---|
committer | Daniel Martí <mvdan@mvdan.cc> | 2019-03-04 09:45:46 +0000 |
commit | d1887676d96daf969d886a4ec13cbad4908d51af (patch) | |
tree | e16c3c152950f50775f254b4b338ab29db55de66 /src/cmd/api/goapi_test.go | |
parent | 0db5534d7acb3c5ce39145ec3aaa490cca1a81ea (diff) | |
download | go-git-d1887676d96daf969d886a4ec13cbad4908d51af.tar.gz |
os/exec: less allocs in the common case
When Stdin, Stdout, and Stderr are nil, there are no goroutines to keep
track of, so we don't need a channel.
And in startProcess, preallocate the right size for sysattr.Files,
saving a bit of space and a couple of slice growth allocs.
name old time/op new time/op delta
ExecHostname-8 419µs ± 0% 417µs ± 1% ~ (p=0.093 n=6+6)
name old alloc/op new alloc/op delta
ExecHostname-8 6.40kB ± 0% 6.28kB ± 0% -1.86% (p=0.002 n=6+6)
name old allocs/op new allocs/op delta
ExecHostname-8 34.0 ± 0% 31.0 ± 0% -8.82% (p=0.002 n=6+6)
Change-Id: Ic1d617f29e9c6431cdcadc7f9bb992750a6d5f48
Reviewed-on: https://go-review.googlesource.com/c/164801
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/api/goapi_test.go')
0 files changed, 0 insertions, 0 deletions