]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile/ssa: add nilcheckelim benchmarks
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 25 Jun 2015 21:04:55 +0000 (14:04 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 29 Jun 2015 04:07:11 +0000 (04:07 +0000)
commit1746e711ad7429248af4d17a57413aeaab0c2095
tree1c70d83dbaf87fd4ee857dc6d96bc267fb1fd25a
parentd9a704cd40e8d248b473a831f099d8d4ca4c409b
[dev.ssa] cmd/compile/ssa: add nilcheckelim benchmarks

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/11520
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/dom.go
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssa/nilcheck.go
src/cmd/compile/internal/ssa/nilcheck_test.go [new file with mode: 0644]