]> Cypherpunks repositories - gostls13.git/commit
go/build: replace ioutil.ReadDir with os.ReadDir
authorCharlie Vieth <charlie.vieth@gmail.com>
Sat, 12 Mar 2022 22:27:42 +0000 (17:27 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 11 May 2022 13:52:09 +0000 (13:52 +0000)
commit536282763f7357edd81d85993c12fd977fecd378
tree25c20f32a0909f7ef7714164ab295ec4bc152520
parent636c5f02082e4be5ef2d9a66c99c9e31b72246a3
go/build: replace ioutil.ReadDir with os.ReadDir

Change go/build.readDir to use os.ReadDir instead of ioutil.ReadDir.
This addresses a TODO and improves performance on Darwin and Linux.

Darwin: Apple M1
name              old time/op    new time/op    delta
ImportVendor-10     39.8µs ± 1%    37.0µs ± 1%  -6.91%  (p=0.000 n=10+10)

Linux: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
name              old time/op    new time/op    delta
ImportVendor-16     22.9µs ±11%    21.2µs ± 5%  -7.47%  (p=0.001 n=10+9)

Updates #45557

Change-Id: Ib1bd2e66210e714e499a035847d6261b61b7e2c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/392074
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/go/build/build.go
src/go/build/build_test.go