]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add size hint to map literal allocations
authorKeith Randall <khr@golang.org>
Sun, 29 May 2016 18:16:13 +0000 (11:16 -0700)
committerKeith Randall <khr@golang.org>
Tue, 16 Aug 2016 17:19:48 +0000 (17:19 +0000)
commit1faea596e4f94e0a4170eda3d1a217b4936d8aa6
tree9604dcfae425134a466159429e784d5de0c73a7c
parent35e25ef62efc5917481e11ff6e7a5cc12468b0e2
cmd/compile: add size hint to map literal allocations

Might as well tell the runtime how large the map is going to be.
This avoids grow work and allocations while the map is being built.

Will wait for 1.8.

Fixes #15880
Fixes #16279

Change-Id: I377e3e5ec1e2e76ea2a50cc00810adda20ad0e79
Reviewed-on: https://go-review.googlesource.com/23558
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/syntax.go