benchmark

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package benchmark provides benchmark utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MemoryCostOf

func MemoryCostOf(nArray int, indexes []int32, elts [][]byte) int64

MemoryCostOf detect memory increment after creating "nArray" Array-s.

func NewBytesArray

func NewBytesArray(indexes []int32, elts [][]byte) (*array.Array, error)

NewBytesArray creates a Array from "indexes" and "elts" of []byte.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL