go: cmd/compile: auto-generated code pathologically slow to compile

Please answer these questions before submitting your issue. Thanks!

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

go version go1.7rc1 linux/amd64

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

amd64, linux

  1. What did you do?

go get github.com/zhenjl/xparse/etld

  1. What did you expect to see?

A response in reasonable time.

  1. 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

Most upvoted comments

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.