Skip to content

cmd/compile: regalloc slow for large maps #81663

Closed

Description

@randall77

Run this program, and compile the result:

#!/usr/bin/python3

print("package p")
print("var m = map[string][]string {")
for i in range(20000):
    print("\"x%d\": {\"y%d\",},"%(i,i))
print("}")

Compiles in about 18sec on my machine before CL 751841, but 73sec after CL 751841. -d=ssa/all/time shows regalloc time is the culprit.

@DanielMorsing

Activity

  1. gopherbot commented on Sep 23, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/837445 mentions this issue: cmd/compile: share dominance frontiers during regalloc

  2. gopherbot commented on Sep 23, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/837465 mentions this issue: cmd/compile: special case simple dominance frontier calculation

  3. gopherbot commented on Sep 24, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/838005 mentions this issue: cmd/compile: use sparse maps for frequently zeroed slices

  4. added a commit that references this issue on Sep 24, 2026
    a0fa722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions