]> Cypherpunks repositories - gostls13.git/commit
cmd/6g, cmd/8g: make 2/3 word sgen more efficient
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 9 Jan 2015 20:41:47 +0000 (12:41 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 12 Feb 2015 22:19:38 +0000 (22:19 +0000)
commit747c8498339b799eb613db1701a927a3549d389a
treeb7edbd0d7b3368d5d0e1ffb227474c47bc81ee61
parentc1c3ce6b36bd4324f17b422d6127ae6d5dd7bae4
cmd/6g, cmd/8g: make 2/3 word sgen more efficient

When compiling the stdlib most of the calls
to sgen are for exactly 2 or 3 words:
85% for 6g and 70% for 8g.
Special case them for performance.
This optimization is not relevant to 5g and 9g.

6g

benchmark                old ns/op     new ns/op     delta
BenchmarkCopyFat16       3.25          0.82          -74.77%
BenchmarkCopyFat24       5.47          0.95          -82.63%

8g

benchmark               old ns/op     new ns/op     delta
BenchmarkCopyFat8       3.84          2.42          -36.98%
BenchmarkCopyFat12      4.94          2.15          -56.48%

Change-Id: I8bc60b453f12597dfd916df2d072a7d5fc33ab85
Reviewed-on: https://go-review.googlesource.com/2607
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/6g/cgen.c
src/cmd/8g/cgen.c