Greatly increase queue block size.

Previous block size could hold only 256 elements (8KB), which stressed
out the memory allocator. Storing 65536 elements (2MB) per block almost
completely reduces the allocator pressure.
This commit is contained in:
Bartosz Taudul 2020-03-01 01:15:13 +01:00
parent 82f463724c
commit e9a32d5dc7

View File

@ -191,7 +191,7 @@ struct ConcurrentQueueDefaultTraits
// but many producers, a smaller block size should be favoured. For few producers
// and/or many elements, a larger block size is preferred. A sane default
// is provided. Must be a power of 2.
static const size_t BLOCK_SIZE = 256;
static const size_t BLOCK_SIZE = 64*1024;
// For explicit producers (i.e. when using a producer token), the block is
// checked for being empty by iterating through a list of flags, one per element.