mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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>
This commit is contained in:
parent
d9a704cd40
commit
1746e711ad
4 changed files with 61 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ var Opt = opt
|
|||
var Deadcode = deadcode
|
||||
|
||||
type DummyFrontend struct {
|
||||
t *testing.T
|
||||
t testing.TB
|
||||
}
|
||||
|
||||
func (DummyFrontend) StringSym(s string) interface{} {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue