name old allocs/op new allocs/op delta
Template 394k ± 0% 391k ± 0% -0.80% (p=0.000 n=10+10)
Unicode 350k ± 0% 349k ± 0% -0.27% (p=0.000 n=10+10)
GoTypes 1.18M ± 0% 1.17M ± 0% -0.92% (p=0.000 n=10+10)
Compiler 4.18M ± 0% 4.14M ± 0% -1.05% (p=0.000 n=10+10)
Change-Id: I838a4e2110afe6496c535b9a0ec5aa882d63a707
Reviewed-on: https://go-review.googlesource.com/32223
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
result.mark = UNVISITED
result.first = prog
result.last = prog
- result.pred = make([]*BasicBlock, 0, 2)
- result.succ = make([]*BasicBlock, 0, 2)
+ // We want two 0-len slices with capacity 2.
+ // Carve them out of a single allocation.
+ blocks := make([]*BasicBlock, 4)
+ result.pred = blocks[0:][:0:2]
+ result.succ = blocks[2:][:0:2]
return result
}