mirror of https://github.com/poanetwork/gecko.git
15 lines
720 B
Go
15 lines
720 B
Go
package database
|
|
|
|
const (
|
|
// MaxExcessCapacityFactor ...
|
|
// If, when a batch is reset, the cap(batch)/len(batch) > MaxExcessCapacityFactor,
|
|
// the underlying array's capacity will be reduced by a factor of capacityReductionFactor.
|
|
// Higher value for MaxExcessCapacityFactor --> less aggressive array downsizing --> less memory allocations
|
|
// but more unnecessary data in the underlying array that can't be garbage collected.
|
|
// Higher value for CapacityReductionFactor --> more aggressive array downsizing --> more memory allocations
|
|
// but less unnecessary data in the underlying array that can't be garbage collected.
|
|
MaxExcessCapacityFactor = 4
|
|
// CapacityReductionFactor ...
|
|
CapacityReductionFactor = 2
|
|
)
|