runtime: cache unrolled GC bitmask

Cache unrolled GC bitmask for types up to 64/32K on 64/32-bit systems,
this corresponds to up to 4K cached bitmask.
Perf builders say that 2% of time is spent in unrollgcproginplace_m/unrollgcprog1
on http benchmark:
http://goperfd.appspot.com/log/f42045f45bf61a0da53b724a7c8567824a0ad6c9

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews, khr, rlh
https://golang.org/cl/122680043
This commit is contained in:
Dmitriy Vyukov 2014-08-24 12:04:51 +04:00
parent 651d0cf204
commit b91223edd1
2 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,7 @@ const (
bitsMask = 1<<bitsPerPointer - 1
pointersPerByte = 8 / bitsPerPointer
bitPtrMask = bitsMask << 2
maxGCMask = 0 // disabled because wastes several bytes of memory
maxGCMask = 64
bitsDead = 0
bitsPointer = 2

View File

@ -55,7 +55,8 @@ enum {
BitsIface = 2,
BitsEface = 3,
MaxGCMask = 0, // disabled because wastes several bytes of memory
// 64 bytes cover objects of size 1024/512 on 64/32 bits, respectively.
MaxGCMask = 64,
};
// Bits in per-word bitmap.