go/src/runtime/map_benchmark_test.go

var mapbench

const size

func BenchmarkHashStringSpeed(b *testing.B) {}

type chunk

func BenchmarkHashBytesSpeed(b *testing.B) {}

func BenchmarkHashInt32Speed(b *testing.B) {}

func BenchmarkHashInt64Speed(b *testing.B) {}

func BenchmarkHashStringArraySpeed(b *testing.B) {}

func BenchmarkMegMap(b *testing.B) {}

func BenchmarkMegOneMap(b *testing.B) {}

func BenchmarkMegEqMap(b *testing.B) {}

func BenchmarkMegEmptyMap(b *testing.B) {}

func BenchmarkMegEmptyMapWithInterfaceKey(b *testing.B) {}

func BenchmarkSmallStrMap(b *testing.B) {}

func BenchmarkMapStringKeysEight_16(b *testing.B) {}

func BenchmarkMapStringKeysEight_32(b *testing.B) {}

func BenchmarkMapStringKeysEight_64(b *testing.B) {}

func BenchmarkMapStringKeysEight_1M(b *testing.B) {}

func benchmarkMapStringKeysEight(b *testing.B, keySize int) {}

func BenchmarkMapFirst(b *testing.B) {}

func BenchmarkMapMid(b *testing.B) {}

func BenchmarkMapLast(b *testing.B) {}

func BenchmarkMapCycle(b *testing.B) {}

// Accessing the same keys in a row.
func benchmarkRepeatedLookup(b *testing.B, lookupKeySize int) {}

func BenchmarkRepeatedLookupStrMapKey32(b *testing.B) {}

func BenchmarkRepeatedLookupStrMapKey1M(b *testing.B) {}

func BenchmarkMakeMap(b *testing.B) {}

func BenchmarkNewEmptyMap(b *testing.B) {}

func BenchmarkNewSmallMap(b *testing.B) {}

func BenchmarkSameLengthMap(b *testing.B) {}

func BenchmarkSmallKeyMap(b *testing.B) {}

func BenchmarkMapPopulate(b *testing.B) {}

type ComplexAlgKey

func BenchmarkComplexAlgMap(b *testing.B) {}

func BenchmarkGoMapClear(b *testing.B) {}

func BenchmarkMapStringConversion(b *testing.B) {}

var BoolSink

func BenchmarkMapInterfaceString(b *testing.B) {}

func BenchmarkMapInterfacePtr(b *testing.B) {}

var hintLessThan8

var hintGreaterThan8

func BenchmarkNewEmptyMapHintLessThan8(b *testing.B) {}

func BenchmarkNewEmptyMapHintGreaterThan8(b *testing.B) {}

func benchSizes(f func(b *testing.B, n int)) func(*testing.B) {}

type smallType

type mediumType

type bigType

type mapBenchmarkKeyType

type mapBenchmarkElemType

func genIntValues[T int | int32 | int64](start, end int) []T {}

func genStringValues(start, end int) []string {}

func genSmallValues(start, end int) []smallType {}

func genMediumValues(start, end int) []mediumType {}

func genBigValues(start, end int) []bigType {}

func genPtrValues[T any](start, end int) []*T {}

func genIntSliceValues[T int | int32 | int64](start, end int) [][]T {}

func genValues[T mapBenchmarkElemType](start, end int) []T {}

// Avoid inlining to force a heap allocation.
//
//go:noinline
func newSink[T mapBenchmarkElemType]() *T {}

// Return a new maps filled with keys and elems. Both slices must be the same length.
func fillMap[K mapBenchmarkKeyType, E mapBenchmarkElemType](keys []K, elems []E) map[K]E {}

func iterCount(b *testing.B, n int) int {}

func checkAllocSize[K, E any](b *testing.B, n int) {}

func benchmarkMapIter[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapIter(b *testing.B) {}

func benchmarkMapAccessHit[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAccessHit(b *testing.B) {}

var sinkOK

func benchmarkMapAccessMiss[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAccessMiss(b *testing.B) {}

// Assign to a key that already exists.
func benchmarkMapAssignExists[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAssignExists(b *testing.B) {}

// Fill a map of size n with no hint. Time is per-key. A new map is created
// every n assignments.
//
// TODO(prattmic): Results don't make much sense if b.N < n.
// TODO(prattmic): Measure distribution of assign time to reveal the grow
// latency.
func benchmarkMapAssignFillNoHint[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAssignFillNoHint(b *testing.B) {}

// Identical to benchmarkMapAssignFillNoHint, but additionally measures the
// latency of each mapassign to report tail latency due to map grow.
func benchmarkMapAssignGrowLatency[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAssignGrowLatency(b *testing.B) {}

// Fill a map of size n with size hint. Time is per-key. A new map is created
// every n assignments.
//
// TODO(prattmic): Results don't make much sense if b.N < n.
func benchmarkMapAssignFillHint[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAssignFillHint(b *testing.B) {}

// Fill a map of size n, reusing the same map. Time is per-key. The map is
// cleared every n assignments.
//
// TODO(prattmic): Results don't make much sense if b.N < n.
func benchmarkMapAssignFillClear[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapAssignFillClear(b *testing.B) {}

// Modify values using +=.
func benchmarkMapAssignAddition[K mapBenchmarkKeyType, E int32 | int64 | string](b *testing.B, n int) {}

func BenchmarkMapAssignAddition(b *testing.B) {}

// Modify values append.
func benchmarkMapAssignAppend[K mapBenchmarkKeyType](b *testing.B, n int) {}

func BenchmarkMapAssignAppend(b *testing.B) {}

func benchmarkMapDelete[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapDelete(b *testing.B) {}

// Use iterator to pop an element. We want this to be fast, see
// https://go.dev/issue/8412.
func benchmarkMapPop[K mapBenchmarkKeyType, E mapBenchmarkElemType](b *testing.B, n int) {}

func BenchmarkMapPop(b *testing.B) {}