Skip to content

cmd/compile: large, simple array 75x slower to compile with -race #57657

Closed
@josharian

Description

@josharian

Compile this file with and without -race:

https://gist.githubusercontent.com/josharian/7e19da2d4c68d004ffebf510aeb8ef69/raw/5c475f906ce7a515d45d8bb5ae5c701469682b8a/x.go

On my laptop, it compiles without -race in 1.5s. With -race, it takes over 100s.

This is extracted and simplified from real code that was causing repeated CI build timeouts, meaning it was taking upwards of 10 minutes to build on a slow CI machine.

Reproduced with both 1.19.4 and 1.20rc2.

I haven't investigated at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.ToolSpeedcompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions