Documentation ¶
Overview ¶
Package benchmark provides benchmark utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MemoryCostOf ¶
MemoryCostOf detect memory increment after creating "nArray" Array-s.
Types ¶
type MemoryUsage ¶
type MemoryUsage struct { // MaxIndex is the last and max index in an array. MaxIndex int32 // EltSize is the size in byte of an array element. EltSize int // EltCnt is the number of element in an array. EltCnt int32 // ArraySize is the memory cost in total for an array. ArraySize int64 // UserDataSize is the user data size. UserDataSize int64 // LoadFactor describe how full an array is and is roughly the ratio of // EltCnt to MaxIndex. // Its value is in (0, 1] LoadFactor float64 // Overhead is how much else memory in byte is used by an array, except // user-data. // Its value is in (0, +oo) Overhead float64 }
MemoryUsage describe settings for an Array and memory cost.
func CollectMemoryUsage ¶
func CollectMemoryUsage(factor float64, maxIdx int32, eltSize int) *MemoryUsage
CollectMemoryUsage create several Array and check how much memory it costs.
Click to show internal directories.
Click to hide internal directories.