Change information
Commit message:
runtime: consolidate tiny sizespecializedmalloc functions
In the sizespecializedmalloc goexperiment, we specialized the tiny
function per tiny size, so there was a different allocation function per
size from 1-15. This created a lot of functions for a code path that was
not executed that often. From the microbenchmarks, comparing the
consolidated tiny function in this cl with the per-size functions, the
specialized functions could be up to 20% faster, but for 8 byte
allocations, which are almost certainly the most common, the per-size
function was slower.
Look at the change description of CL 766980 for the results of those
microbenchmarks. The CL also contains the code used to run the
benchmark.
Since we've noticed significant icache pressure from all the functions,
and, the tiny functions aren't used as much as the other ones, and the
benefits seem to be mixed, consolidate the 15 functions into a single
function.
This cuts the size of the mallocgc* functions by about 20%.
For #79286
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_c2s16-perf_vs_parent-sizespecializedmalloc,gotip-linux-amd64_c3h88-perf_vs_parent-sizespecializedmalloc,gotip-linux-arm64_c4ah72-perf_vs_parent-sizespecializedmalloc,gotip-linux-arm64_c4as16-perf_vs_parent-sizespecializedmalloc,gotip-linux-arm64_c4as16-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-amd64_c2s16-perf_vs_parent
Change-Id: I824f65727a858158c14d2edd6fea1e846a6a6964
Files:
- M src/cmd/compile/internal/ir/symtab.go
- M src/cmd/compile/internal/ssa/rewrite.go
- M src/cmd/compile/internal/ssagen/ssa.go
- M src/runtime/_mkmalloc/mkmalloc.go
- M src/runtime/malloc.go
- M src/runtime/malloc_generated.go
- M src/runtime/malloc_stubs.go
- M src/runtime/malloc_tables_generated.go
- M test/codegen/strings.go
- M test/live.go
- M test/live_regabi.go
Change size: XL
Delta: 11 files changed, 101 insertions(+), 2277 deletions(-)
Branch: refs/heads/master