benchmark

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package benchmark provides internally used benchmark support

Index

Constants

This section is empty.

Variables

View Source
var OutputMSAB int32 = 0
View Source
var Rec int32

Functions

This section is empty.

Types

type Config

type Config struct {
	KeyCnt int
	KeyLen int
	ValLen int
}

Config defines the variable inputs struct in one benchmark.

type FPRResult added in v0.5.1

type FPRResult struct {
	KeyCount int     `tw-title:"key-count"`
	FPR      float64 `tw-title:"fpr" tw-fmt:"%.3f%%"`
}

FPRResult represent the false positive rate.

func GetFPR added in v0.5.1

func GetFPR(keyCounts []int) []FPRResult

GetFPR estimate false positive rate(FPR) for Get.

type GetResult added in v0.3.1

type GetResult struct {
	KeyCount int `tw-title:"key-count"`
	K64      int `tw-title:"k=64"`
	K128     int `tw-title:"k=128"`
	K256     int `tw-title:"k=256"`
}

GetResult represent the ns/Get() for virous key count and several predefined key length = 64, 128, 256

func GetAbsent added in v0.3.1

func GetAbsent(keyCounts []int) []GetResult

GetAbsent benchmark the Get() of absent key.

func GetPresent added in v0.3.1

func GetPresent(keyCounts []int) []GetResult

GetPresent benchmark the Get() of present key.

type GetSetting added in v0.3.1

type GetSetting struct {
	Keys   []string
	Values []int32

	AbsentKeys []string

	SlimKV *slimKV
	Map    map[string]int32
	Btree  *btree.BTree

	SearchKey   string
	SearchValue int32
}

GetSetting defines benchmark data source.

func NewGetSetting added in v0.3.1

func NewGetSetting(cnt int, keyLen int) *GetSetting

type KVElt added in v0.5.10

type KVElt struct {
	Key string
	Val int32
}

KVElt defines a key-value struct to be used as a value in SlimTrie in test.

func (*KVElt) Less added in v0.5.10

func (kv *KVElt) Less(than btree.Item) bool

Less is used to implements google/btree.Item

type MSABResult added in v0.5.10

type MSABResult struct {
	KeyCount int `tw-title:"key-count"`
	Map      int `tw-title:"map"`
	Slim     int `tw-title:"SlimTrie"`
	Array    int `tw-title:"array"`
	Btree    int `tw-title:"Btree"`
}

MSABResult defines the ns/Get() for Map, SlimTrie, Array and Btree.

func GetMapSlimArrayBtree added in v0.5.10

func GetMapSlimArrayBtree(keyCounts []int) []MSABResult

type MemResult added in v0.3.1

type MemResult GetResult

MemResult is a alias of GetResult

func Mem added in v0.3.1

func Mem(keyCounts []int) []MemResult

type SearchResult

type SearchResult struct {
	KeyCnt                int
	KeyLen                int
	ExsitingKeyNsPerOp    int64
	NonexsitentKeyNsPerOp int64
}

SearchResult show the key search result with a constructed data. Used to transfer benchmark result currently. SearchResult also defines the column titles when output to a chart.

Jump to

Keyboard shortcuts

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