Skip to content

cmd/compile: slow with many methods on parameterized type #51957

Open
@seborama

Description

@seborama

What version of Go are you using (go version)?

$ go version
go version go1.18 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOVERSION="go1.18"

What did you do?

git clone [email protected]:seborama/fuego.git -b v11_type_parameters && cd fuego
Edit file comparable_test.go and add a comment anywhere in the file then save. This step is to ensure the build is executed without caching.
go test -timeout 10s -v ./... -count 1 -run TestComparableStream_Max
The execution of the test takes over 1 minute on my computer, rather than < 3s normally.

This problem may have started after I added mapto.go (generated via make generate).

The reason for generating so many parameterised methods comes from issue 49085.

What did you expect to see?

A fast test execution, at most 3 seconds, likely under 1s.

What did you see instead?

The outcome is correct, but the test build takes a drastically long time.

Right now, I only have one computer on which to test this issue.
This may conceivably be related to an unknown particular of my environment set-up, although I cannot think of any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Triage Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions