• Josh Bleecher Snyder's avatar
    [dev.ssa] cmd/compile/ssa: add nilcheckelim benchmarks · 1746e711
    Josh Bleecher Snyder authored
    These benchmarks demonstrate that
    the nilcheckelim pass is roughly O(n^2):
    
    BenchmarkNilCheckDeep1    	 2000000	       741 ns/op	   1.35 MB/s
    BenchmarkNilCheckDeep10   	 1000000	      2237 ns/op	   4.47 MB/s
    BenchmarkNilCheckDeep100  	   20000	     60713 ns/op	   1.65 MB/s
    BenchmarkNilCheckDeep1000 	     200	   7925198 ns/op	   0.13 MB/s
    BenchmarkNilCheckDeep10000	       1	1220104252 ns/op	   0.01 MB/s
    
    Profiling suggests that building the
    dominator tree is also O(n^2),
    and before size factors take over,
    considerably more expensive than nilcheckelim.
    
    Change-Id: If966b38ec52243a25f355dab871300d29db02e16
    Reviewed-on: https://go-review.googlesource.com/11520Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    1746e711
export_test.go 695 Bytes