go: runtime: os.File 1.2x slower, no longer parallel, in tip compared to go18 (regression)

Please answer these questions before submitting your issue. Thanks!

What did you do?

Hello up there. During discussion in #19563 it was found that in go tip e.g. os.File.ReadAt became ~ 1.2x slower compared to go18. Let me quote https://github.com/golang/go/issues/19563#issuecomment-287296706:

name \ time/op  go14.txt    go15.txt    go16.txt    go17.txt    go18.txt    gotip.txt
ReadAt1         268ns ± 1%
Pread1          259ns ± 1%
ReadAt1-4                   274ns ± 1%  277ns ± 1%  274ns ± 1%  263ns ± 1%  323ns ± 0%
Pread1-4                    262ns ± 1%  266ns ± 1%  262ns ± 2%  252ns ± 1%  251ns ± 1%

(updated benchmark, diff)

The differencein between os.File.ReadAt(len(buf)=1) and syscall.Pread(len(buf)=1) was ~ 10ns during go14 - go18. With go tip it raises to ~70ns, so it is indeed 60ns regression for os.File.ReadAt.

What did you expect to see?

os.File.ReadAt and friends works the same speed or faster compared to go18.

What did you see instead?

os.File.ReadAt became slower by 60ns compared to go18.

Does this issue reproduce with the latest release (go1.8)?

No.

This is probably related to recently introduced runtime poller.

Thanks beforehand, Kirill

/cc @ianlancetaylor

System details

go version devel +88e47187c1 Fri Mar 17 05:21:53 2017 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/kirr/src/tools/go/g.env"
GORACE=""
GOROOT="/home/kirr/src/tools/go/go"
GOTOOLDIR="/home/kirr/src/tools/go/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build094114164=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOROOT/bin/go version: go version devel +88e47187c1 Fri Mar 17 05:21:53 2017 +0000 linux/amd64
GOROOT/bin/go tool compile -V: compile version devel +88e47187c1 Fri Mar 17 05:21:53 2017 +0000 X:framepointer
uname -sr: Linux 4.9.0-2-amd64
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.0 (stretch)
Release:	9.0
Codename:	stretch
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.24-9) stable release version 2.24, by Roland McGrath et al.
gdb --version: GNU gdb (Debian 7.12-6) 7.12.0.20161007-git

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 17 (15 by maintainers)

Commits related to this issue

Most upvoted comments

CL https://golang.org/cl/41670 mentions this issue.