Skip to content

internal/maps: performance regression in MapFirst, MapLast etc in 1.27rc2 vs 1.26.5 #80699

Description

@archanaravindar

Go version

go1.27rc2, also in the master

Output of go env in your module/workspace:

GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/archanaravindar/Go/Go_master/go/bin'
GOCACHE='/home/archanaravindar/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/archanaravindar/.config/go/env'
GOEXE=''
GOEXPERIMENT='nodwarf5'
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3127455941=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/archanaravindar/Downloads/perfdash/go-test-work/go1.27rc2/src/go.mod'
GOMODCACHE='/home/archanaravindar/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/archanaravindar/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/golang'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/archanaravindar/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/golang/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.12 X:nodwarf5'

What did you do?

Ran MapFirst, MapLast tests in go1.26.5 and go1.27rc2

What did you see happen?

Benchmark performance is slower in go1.27rc2 compared to go1.26.5
│ mapfirstallold.out │ ../../../go1.27rc2/src/runtime/mapfirstallnew.out │
│ sec/op │ sec/op vs base │
MapFirst/1-8 2.218n ± 2% 3.218n ± 1% +45.12% (p=0.000 n=10)
MapFirst/2-8 2.290n ± 4% 3.306n ± 3% +44.36% (p=0.000 n=10)
MapFirst/3-8 2.265n ± 5% 3.354n ± 2% +48.08% (p=0.000 n=10)
MapFirst/4-8 2.327n ± 2% 3.410n ± 3% +46.54% (p=0.000 n=10)
MapFirst/5-8 2.410n ± 5% 3.457n ± 3% +43.42% (p=0.000 n=10)
MapFirst/6-8 2.385n ± 5% 3.419n ± 4% +43.32% (p=0.000 n=10)
MapFirst/7-8 2.434n ± 6% 3.586n ± 5% +47.30% (p=0.000 n=10)
MapFirst/8-8 2.470n ± 3% 3.530n ± 3% +42.91% (p=0.000 n=10)
MapFirst/9-8 5.015n ± 8% 5.792n ± 4% +15.48% (p=0.000 n=10)
MapFirst/10-8 5.020n ± 7% 5.688n ± 3% +13.32% (p=0.000 n=10)
MapFirst/11-8 5.143n ± 4% 5.814n ± 4% +13.04% (p=0.000 n=10)
MapFirst/12-8 5.145n ± 4% 5.769n ± 4% +12.12% (p=0.000 n=10)
MapFirst/13-8 5.071n ± 6% 5.949n ± 6% +17.33% (p=0.000 n=10)
MapFirst/14-8 5.228n ± 5% 5.619n ± 7% +7.48% (p=0.000 n=10)
MapFirst/15-8 5.009n ± 2% 5.874n ± 4% +17.27% (p=0.000 n=10)
MapFirst/16-8 5.072n ± 4% 5.831n ± 4% +14.95% (p=0.000 n=10)
geomean 3.457n 4.443n +28.53%

What did you expect to see?

Performance should have been on par on both releases
this not only affects amd64 but other platforms such as ppc64le

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions