]> Cypherpunks repositories - gostls13.git/commit
runtime: shorten reflect.unsafe_New call chain
authorMartin Möhrmann <moehrmann@google.com>
Sun, 28 Jan 2018 18:46:57 +0000 (19:46 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 21 Feb 2018 00:31:21 +0000 (00:31 +0000)
commit8999b1d6c9be053f0e8c07ac3516eef7dc8a1830
tree7c19fb7ec42d763c7c7a2eb069ba9d18da9bc4f4
parentb43ebce59b0eabe10ea2a1950c7173ed029cd093
runtime: shorten reflect.unsafe_New call chain

reflect.unsafe_New is an often called function according
to profiling in a large production environment.

Since newobject is not inlined currently there
is call overhead that can be avoided by calling
mallocgc directly.

name  old time/op  new time/op  delta
New   32.4ns ± 2%  29.8ns ± 1%  -8.03%  (p=0.000 n=19+20)

Change-Id: I572e4be830ed8e5c0da555dc3a8864c8363112be
Reviewed-on: https://go-review.googlesource.com/95015
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/malloc.go