go: cmd/compile: auto-generated code pathologically slow to compile
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version
)?
go version go1.7rc1 linux/amd64
- What operating system and processor architecture are you using (
go env
)?
amd64, linux
- What did you do?
go get github.com/zhenjl/xparse/etld
- What did you expect to see?
A response in reasonable time.
- What did you see instead?
No response - the code takes a very long time to compile.
Under Go 1.4, the package takes ~2s to install. Under Go 1.6, it took ~4s.
Using Go1.7rc1 I killed the compiler after 9 minutes because my machine was overheating and becoming unusable.
It’s a large state machine, but this doesn’t seem like reasonable compiler behaviour.
FWIW this package is used as part of the sequencer
tool (see http://zhen.org/blog/sequence-high-performance-sequential-semantic-log--parser/)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 24 (20 by maintainers)
Commits related to this issue
- Emit fsm code in chunks as opposed single func. Changes genfsm.go to divide the state space into chunks of size 256, then call a helper for function for each chunk (as opposed to having a single gian... — committed to thanm/xparse by thanm 8 years ago
- cmd/compile: move phi args which are constants closer to the phi entry: x = MOVQconst [7] ... b1: goto b2 b2: v = Phi(x, y, z) Transform that program to: entry: ... b1: x = MOVQco... — committed to golang/go by randall77 8 years ago
- cmd/compile: change phi location to be optimistic at backedges This is: (1) a simple trick that cuts the number of phi-nodes (temporarily) inserted into the ssa representation by a factor of 10, and... — committed to golang/go by dr2chase 8 years ago
- cmd/compile: Use Sreedhar+Gao phi building algorithm Should be more asymptotically happy. We process each variable in turn to find all the locations where it needs a phi (the dominance frontier of a... — committed to golang/go by randall77 8 years ago
I created a pull request [as “learn to program in go” exercise] for the fsm generator that divides the state space into chunks, then puts the chunks in separate functions. Each of the new functions is a couple thousand lines long. Bring the total compilation time down to 10-15 seconds.