From e6051de0351bb05d7409ee0d483f932e3530f816 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 4 Oct 2016 10:01:48 -0700 Subject: [PATCH] cmd/compile: lower cse comparison depth Todd originally set cmpDepth to 4. Quoting: I picked a depth of 4 by timing tests of `go tool compile arithConst_ssa.go` and `go test -c net/http`. 3.89 / 3.92 CL w/cmpDepth = 1 3.78 / 3.92 CL w/cmpDepth = 2 3.44 / 3.96 CL w/cmpDepth = 3 3.29 / 3.9 CL w/cmpDepth = 4 3.3 / 3.93 CL w/cmpDepth = 5 3.29 / 3.92 CL w/cmpDepth = 10 I don't see the same behavior now, differences in those two benchmarks are in the noise (between 1 and 4). In issue 17127, CSE takes a really long time. Lowering cmpDepth from 4 to 1 lowers compile time from 8 minutes to 1 minute. Fixes #17127 Change-Id: I6dc544bbcf2a9dca73637d0182d3de1a5ae6c944 Reviewed-on: https://go-review.googlesource.com/30257 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/compile/internal/ssa/cse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/cse.go b/src/cmd/compile/internal/ssa/cse.go index 795950e75d..532232de57 100644 --- a/src/cmd/compile/internal/ssa/cse.go +++ b/src/cmd/compile/internal/ssa/cse.go @@ -10,7 +10,7 @@ import ( ) const ( - cmpDepth = 4 + cmpDepth = 1 ) // cse does common-subexpression elimination on the Function. -- 2.48.1