• Rémy Oudompheng's avatar
    cmd/gc, runtime: inline append in frontend. · 045dbeaf
    Rémy Oudompheng authored
    A new transformation during walk turns append calls
    into a combination of growslice and memmove.
    
    benchmark                     old ns/op    new ns/op    delta
    BenchmarkAppend                     141          141   +0.00%
    BenchmarkAppend1Byte                 18           11  -39.56%
    BenchmarkAppend4Bytes                19           10  -42.63%
    BenchmarkAppend7Bytes                18           10  -42.16%
    BenchmarkAppend8Bytes                18           10  -40.44%
    BenchmarkAppend15Bytes               19           11  -41.67%
    BenchmarkAppend16Bytes               19           11  -41.97%
    BenchmarkAppend32Bytes               23           14  -38.82%
    BenchmarkAppendStr1Byte              14           10  -23.78%
    BenchmarkAppendStr4Bytes             14           11  -21.13%
    BenchmarkAppendStr8Bytes             14           10  -25.17%
    BenchmarkAppendStr16Bytes            19           11  -41.45%
    BenchmarkAppendStr32Bytes            18           14  -19.44%
    BenchmarkAppendSpecialCase           62           63   +1.77%
    
    R=golang-dev, khr, cshapiro, rsc, dave
    CC=golang-dev
    https://golang.org/cl/12815046
    045dbeaf
arch_arm.h 262 Bytes