go: cmd/compile: compilation of a package >100x slower with 1.20rc3
The package in question is https://github.com/benoitkugler/textlayout/fonts/glyphsnames in v0.3.0, with go 1.19:
$ go version
go version go1.19.1 linux/amd64
$ time go build
real 0m4,086s
user 0m5,970s
sys 0m0,447s
with go 1.20rc3 I got bored of waiting after 10 minutes, so it’s at least 100x slower, but possibly a lot more (for all I know it could be in an infinite loop).
The code in question seems to have some very large (and very questionable) switch statements.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (12 by maintainers)
Commits related to this issue
- Revert "cmd/compile: teach prove about bitwise OR operation" This reverts commit 3680b5e9c4f42fcf9155aa42b3b344d1fbe19571. Reason for revert: causes long compile times on certain functions. See issu... — committed to golang/go by randall77 a year ago
- [release-branch.go1.20] Revert "cmd/compile: teach prove about bitwise OR operation" This reverts commit 3680b5e9c4f42fcf9155aa42b3b344d1fbe19571. Reason for revert: causes long compile times on cer... — committed to golang/go by randall77 a year ago
- cmd/compile: teach prove about bitwise OR operation For now, only apply the rule if either of arguments are constants. That would catch a lot of real user code, without slowing down the compiler with... — committed to golang/go by cuonglm a year ago
there’s a 12000 line / 6000 case switch in there
This is fixed at tip. Milestoning for 1.20 for the backport.