]> Cypherpunks repositories - gostls13.git/commit
runtime: avoid calling adjustpointers unnecessarily
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 4 Apr 2018 16:24:13 +0000 (09:24 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 5 Apr 2018 21:43:23 +0000 (21:43 +0000)
commit2e7e57770c71109cc036478c656309c41ddee143
tree4121ce617c21dff18eec35af08372f6a0fa0f745
parent533fdfd00e3c1fb84078e3ed9fa2c2c646fbac8c
runtime: avoid calling adjustpointers unnecessarily

adjustpointers loops over a bitmap.
If the length of that bitmap is zero,
we can skip making the call entirely.
This speeds up stack copying when there are
no pointers present in either args or locals.

name                old time/op  new time/op  delta
StackCopyPtr-8       101ms ± 4%    90ms ± 4%  -10.95%  (p=0.000 n=87+93)
StackCopy-8         80.1ms ± 4%  72.6ms ± 4%   -9.41%  (p=0.000 n=98+100)
StackCopyNoCache-8   121ms ± 3%   113ms ± 3%   -6.57%  (p=0.000 n=98+97)

Change-Id: I7a272e19bc9a14fa3e3318771ebd082dc6247d25
Reviewed-on: https://go-review.googlesource.com/104737
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/stack.go