• Rémy Oudompheng's avatar
    cmd/gc: enable inlining in generated method wrappers. · 386ad0ab
    Rémy Oudompheng authored
    Method calls on interfaces with large stored values
    will call the pointer receiver method which may be
    a wrapper over a method with value receiver.
    
    This is particularly inefficient for very small bodies.
    Inlining the wrapped method body saves a potentially expensive
    function call.
    
    benchmark                old ns/op    new ns/op    delta
    BenchmarkSortString1K       802295       641387  -20.06%
    BenchmarkSortInt1K          359914       238234  -33.81%
    BenchmarkSortInt64K       35764226     22803078  -36.24%
    
    Fixes #4707.
    
    R=golang-dev, daniel.morsing, rsc
    CC=golang-dev
    https://golang.org/cl/7214044
    386ad0ab
subr.c 67.1 KB