]> Cypherpunks repositories - gostls13.git/commit
runtime: call mallocgc directly from makeslice and growslice
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 19 Apr 2016 22:14:26 +0000 (15:14 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 20 Apr 2016 00:05:36 +0000 (00:05 +0000)
commit0150f15a924a7b4ac0c794012f6b12c8aa406b54
treece022ac8a79549faf47f16d84bc86784fd4e0066
parent7b0ba1cff86429f0eb39b916fba54e3061fa5787
runtime: call mallocgc directly from makeslice and growslice

The extra checks provided by newarray are
redundant in these cases.

This shrinks by one frame the call stack expected
by the pprof test.

name                      old time/op  new time/op  delta
MakeSlice-8               34.3ns ± 2%  30.5ns ± 3%  -11.03%  (p=0.000 n=24+22)
GrowSlicePtr-8             134ns ± 2%   129ns ± 3%   -3.25%  (p=0.000 n=25+24)

Change-Id: Icd828655906b921c732701fd9d61da3fa217b0af
Reviewed-on: https://go-review.googlesource.com/22276
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/pprof/mprof_test.go
src/runtime/slice.go