common

package
v0.0.0-...-cd097ab Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Seed int64 = 42

Seed is the fixed random seed used for reproducible benchmark inputs.

Variables

This section is empty.

Functions

func ConsumeBytes

func ConsumeBytes(data []byte)

ConsumeBytes mixes a byte slice into the global sink.

func ConsumeUint64

func ConsumeUint64(value uint64)

ConsumeUint64 mixes a value into the global sink.

func MBPerSecond

func MBPerSecond(processed int64, elapsed time.Duration) float64

MBPerSecond calculates MiB/s throughput.

func MedianDuration

func MedianDuration(samples []time.Duration) time.Duration

MedianDuration returns the median sample.

func MedianFloat64

func MedianFloat64(samples []float64) float64

MedianFloat64 returns the median float64 sample.

func MedianInt64

func MedianInt64(samples []int64) int64

MedianInt64 returns the median int64 sample.

func NewRand

func NewRand() *rand.Rand

NewRand returns a deterministic random source.

func RandomBytes

func RandomBytes(size int) []byte

RandomBytes returns a deterministic byte slice of the requested size.

func RandomInt64Slice

func RandomInt64Slice(count int) []int64

RandomInt64Slice returns a deterministic int64 slice.

func SinkValue

func SinkValue() uint64

SinkValue returns the current sink value.

func TextCorpus

func TextCorpus(size int) []byte

TextCorpus returns a deterministic text-like corpus with repeated patterns.

func WithGCDisabled

func WithGCDisabled(fn func())

WithGCDisabled runs fn while GC is disabled and restores the prior setting afterwards.

Types

This section is empty.

Jump to

Keyboard shortcuts

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