generic

package
v0.0.0-...-4f4ce1e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IterrationsRatio float64 = 1.0

Functions

func Warmup

func Warmup(b BenchmarkInterface, aspect float64)

Types

type ArithmeticsBenchmark

type ArithmeticsBenchmark struct {
	*BenchmarkBaseBase
	R float32
}

func NewArithmetics

func NewArithmetics(writer utils.WriterType, printToConsole bool) *ArithmeticsBenchmark

func (*ArithmeticsBenchmark) BenchImplementation

func (b *ArithmeticsBenchmark) BenchImplementation() interface{}

type BenchResult

type BenchResult struct {
	Elapsed       int64
	Result        float64
	Units         string
	Points        float64
	Ratio         float64
	Output        string
	BenchmarkName string
	Iterrations   int64
	IsParallel    bool
}

func Bench

type BenchmarkBaseBase

type BenchmarkBaseBase struct {
	Iterrations int64

	IterrationsRatio float64
	Ratio            float64
	Name             string
	IsParallel       bool
	Output           utils.WriterType
	Child            BenchmarkInterface
	// contains filtered or unexported fields
}

func NewBenchmarkBase

func NewBenchmarkBase(writer utils.WriterType, printToConsole bool) *BenchmarkBaseBase

func (*BenchmarkBaseBase) AfterBench

func (b *BenchmarkBaseBase) AfterBench(result *BenchResult)

func (*BenchmarkBaseBase) BeforeBench

func (b *BenchmarkBaseBase) BeforeBench()

func (*BenchmarkBaseBase) Bench

func (b *BenchmarkBaseBase) Bench() *BenchResult

func (*BenchmarkBaseBase) BenchImplementation

func (b *BenchmarkBaseBase) BenchImplementation() interface{}

func (*BenchmarkBaseBase) BenchInParallel

func (b *BenchmarkBaseBase) BenchInParallel(buildFunc func() interface{},
	benchFunc func(interface{}) interface{},
	setBenchResultFunc func(interface{}, *BenchResult)) []*BenchResult

func (*BenchmarkBaseBase) BuildParallelResult

func (b *BenchmarkBaseBase) BuildParallelResult(rootResult *BenchResult, results []*BenchResult) *BenchResult

func (*BenchmarkBaseBase) BuildResult

func (b *BenchmarkBaseBase) BuildResult(start int64) *BenchResult

func (*BenchmarkBaseBase) GetIterrations

func (b *BenchmarkBaseBase) GetIterrations() int64

func (*BenchmarkBaseBase) GetName

func (b *BenchmarkBaseBase) GetName() string

func (*BenchmarkBaseBase) PopulateResult

func (b *BenchmarkBaseBase) PopulateResult(benchResult *BenchResult, dhrystoneResult interface{}) *BenchResult

func (*BenchmarkBaseBase) Warmup

func (b *BenchmarkBaseBase) Warmup(aspect float64)

type BenchmarkInterface

type BenchmarkInterface interface {
	BenchImplementation() interface{}

	GetIterrations() int64

	PopulateResult(benchResult *BenchResult, dhrystoneResult interface{}) *BenchResult

	Bench() *BenchResult

	Warmup(aspect float64)

	BeforeBench()

	AfterBench(result *BenchResult)

	BuildResult(start int64) *BenchResult

	GetName() string
}

type CallBenchmark

type CallBenchmark struct {
	*BenchmarkBaseBase
}

func NewCallBenchmark

func NewCallBenchmark(writer utils.WriterType, printToConsole bool) *CallBenchmark

func (*CallBenchmark) Bench

func (b *CallBenchmark) Bench() *BenchResult

type HashBenchmark

type HashBenchmark struct {
	*BenchmarkBaseBase
	// contains filtered or unexported fields
}

func NewHashBenchmark

func NewHashBenchmark(writer utils.WriterType, printToConsole bool) *HashBenchmark

func (*HashBenchmark) BenchImplementation

func (b *HashBenchmark) BenchImplementation() interface{}

type IfElseBenchmark

type IfElseBenchmark struct {
	*BenchmarkBaseBase
}

func NewIfElseBenchmark

func NewIfElseBenchmark(writer utils.WriterType, printToConsole bool) *IfElseBenchmark

func (*IfElseBenchmark) BenchImplementation

func (b *IfElseBenchmark) BenchImplementation() interface{}

type MathBenchmark

type MathBenchmark struct {
	*BenchmarkBaseBase
}

func NewMathBenchmark

func NewMathBenchmark(writer utils.WriterType, printToConsole bool) *MathBenchmark

func (*MathBenchmark) BenchImplementation

func (b *MathBenchmark) BenchImplementation() interface{}

type MemoryBenchmark

type MemoryBenchmark struct {
	*BenchmarkBaseBase
}

func NewMemoryBenchmark

func NewMemoryBenchmark(writer utils.WriterType, printToConsole bool) *MemoryBenchmark

func (*MemoryBenchmark) BenchImplementation

func (b *MemoryBenchmark) BenchImplementation() interface{}

func (*MemoryBenchmark) PopulateResult

func (b *MemoryBenchmark) PopulateResult(benchResult *BenchResult, memoryBenchmarkResult interface{}) *BenchResult

type ParallelArithemticsBenchmark

type ParallelArithemticsBenchmark struct {
	*BenchmarkBaseBase
}

func NewParallelArithmetics

func NewParallelArithmetics(writer utils.WriterType, printToConsole bool) *ParallelArithemticsBenchmark

func (*ParallelArithemticsBenchmark) BenchImplementation

func (b *ParallelArithemticsBenchmark) BenchImplementation() interface{}

type ParallelCallBenchmark

type ParallelCallBenchmark struct {
	*CallBenchmark
}

func NewParallelCallBenchmark

func NewParallelCallBenchmark(writer utils.WriterType, printToConsole bool) *ParallelCallBenchmark

func (*ParallelCallBenchmark) Bench

func (b *ParallelCallBenchmark) Bench() *BenchResult

func (*ParallelCallBenchmark) BenchImplementation

func (b *ParallelCallBenchmark) BenchImplementation() interface{}

func (*ParallelCallBenchmark) BenchInParallel

func (b *ParallelCallBenchmark) BenchInParallel(buildFunc func() interface{}) []*BenchResult

type ParallelHashBenchmark

type ParallelHashBenchmark struct {
	*HashBenchmark
}

func NewParallelHashBenchmark

func NewParallelHashBenchmark(writer utils.WriterType, printToConsole bool) *ParallelHashBenchmark

func (*ParallelHashBenchmark) BenchImplementation

func (b *ParallelHashBenchmark) BenchImplementation() interface{}

type ParallelIfElseBenchmark

type ParallelIfElseBenchmark struct {
	*BenchmarkBaseBase
}

func NewParallelIfElseBenchmark

func NewParallelIfElseBenchmark(writer utils.WriterType, printToConsole bool) *ParallelIfElseBenchmark

func (*ParallelIfElseBenchmark) BenchImplementation

func (b *ParallelIfElseBenchmark) BenchImplementation() interface{}

type ParallelMathBenchmark

type ParallelMathBenchmark struct {
	*BenchmarkBaseBase
}

func NewParallelMathBenchmark

func NewParallelMathBenchmark(writer utils.WriterType, printToConsole bool) *ParallelMathBenchmark

func (*ParallelMathBenchmark) BenchImplementation

func (b *ParallelMathBenchmark) BenchImplementation() interface{}

type ParallelMemoryBenchmark

type ParallelMemoryBenchmark struct {
	*MemoryBenchmark
}

func NewParallelMemoryBenchmark

func NewParallelMemoryBenchmark(writer utils.WriterType, printToConsole bool) *ParallelMemoryBenchmark

func (*ParallelMemoryBenchmark) BenchImplementation

func (b *ParallelMemoryBenchmark) BenchImplementation() interface{}

func (*ParallelMemoryBenchmark) PopulateResult

func (b *ParallelMemoryBenchmark) PopulateResult(benchResult *BenchResult, results interface{}) *BenchResult

type ParallelRandomMemoryBenchmark

type ParallelRandomMemoryBenchmark struct {
	*RandomMemoryBenchmark
}

func NewParallelRandomMemoryBenchmark

func NewParallelRandomMemoryBenchmark(writer utils.WriterType, printToConsole bool) *ParallelRandomMemoryBenchmark

func (*ParallelRandomMemoryBenchmark) BenchImplementation

func (b *ParallelRandomMemoryBenchmark) BenchImplementation() interface{}

func (*ParallelRandomMemoryBenchmark) PopulateResult

func (b *ParallelRandomMemoryBenchmark) PopulateResult(benchResult *BenchResult, results interface{}) *BenchResult

type ParallelStringManipulation

type ParallelStringManipulation struct {
	*BenchmarkBaseBase
}

func NewParallelStringManipulation

func NewParallelStringManipulation(writer utils.WriterType, printToConsole bool) *ParallelStringManipulation

func (*ParallelStringManipulation) BenchImplementation

func (b *ParallelStringManipulation) BenchImplementation() interface{}

type RandomMemoryBenchmark

type RandomMemoryBenchmark struct {
	*BenchmarkBaseBase
}

func NewRandomMemoryBenchmark

func NewRandomMemoryBenchmark(writer utils.WriterType, printToConsole bool) *RandomMemoryBenchmark

func (*RandomMemoryBenchmark) BenchImplementation

func (b *RandomMemoryBenchmark) BenchImplementation() interface{}

func (*RandomMemoryBenchmark) PopulateResult

func (b *RandomMemoryBenchmark) PopulateResult(benchResult *BenchResult, memoryBenchmarkResult interface{}) *BenchResult

type StringManipulation

type StringManipulation struct {
	*BenchmarkBaseBase
}

func NewStringManipulation

func NewStringManipulation(writer utils.WriterType, printToConsole bool) *StringManipulation

func (*StringManipulation) BenchImplementation

func (b *StringManipulation) BenchImplementation() interface{}

Jump to

Keyboard shortcuts

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