Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: an FSM with ~40k states takes a lot of memory to build #19379
What version of Go are you using (
Slow things here: phi insertion, deadcode elimination. Similar to #17926, but not quite a duplicate. Tip is about 5% better than 1.8 on both CPU and memory.
We could do a better job with switch statements, which would make a real difference here. My plan for them is to fix #19250, then move lowering of OSWITCH from the mid-tier to the AST->SSA conversion. That should prevent us from generating many pointless blocks (via labels and gotos), which will mean doing much less work here.
In the meantime, if you want to work around this, a good first step is: if your inner switch statements have dense enough cases, I recommend writing them as array lookups--
pushed a commit
Mar 6, 2017
Tip (85b2940) is better than 1.8, but still not great:
Moving to 1.10.