Commit b91223ed authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent 651d0cf2
......@@ -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
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment