Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cockroachdb/swiss
/ functions
Functions
113 in github.com/cockroachdb/swiss
⨍
Functions
113
◇
Types & classes
26
↓ 57 callers
Method
At
(i uint32)
map.go:1585
↓ 38 callers
Function
benchSizes
( f func(b *testing.B, n int, genKeys func(start, end int) []T), genKeys func(start, end int) []T, )
bench_test.go:117
↓ 22 callers
Method
Put
Put inserts an entry into the map, overwriting an existing value if an entry with the same key already exists.
map.go:415
↓ 19 callers
Method
Get
Get retrieves the value from the map for the specified key, returning ok=false if the key is not present.
map.go:519
↓ 17 callers
Function
genKeys
(start, end int)
bench_test.go:143
↓ 14 callers
Method
checkInvariants
checkInvariants verifies the internal consistency of the map's structure, checking conditions that should always be true for a correctly functioning m
map.go:956
↓ 14 callers
Method
globalDepth
globalDepth returns the number of bits from the top of the hash to use for indexing in the buckets directory.
map.go:864
↓ 12 callers
Method
Len
Len returns the number of entries in the map.
map.go:716
↓ 11 callers
Method
Set
Set sets the i-th control byte.
endian_big.go:31
↓ 10 callers
Method
first
first assumes that only the MSB of each control byte can be set (e.g. bitset is the result of matchEmpty or similar) and returns the relative index of
map.go:1449
↓ 10 callers
Function
h2
Extracts the H2 portion of a hash: the 7 bits not used for h1. These are used as an occupied control byte.
map.go:1641
↓ 8 callers
Method
bucketCount
bucketCount returns the number of buckets in the buckets directory.
map.go:872
↓ 8 callers
Method
buckets
buckets calls yield sequentially for each bucket in the map. If yield returns false, iteration stops. Offset specifies the bucket to start iteration a
map.go:762
↓ 8 callers
Function
noescape
noescape hides a pointer from escape analysis. noescape is the identity function but escape analysis doesn't think the output depends on the input.
map.go:1653
↓ 7 callers
Method
All
All calls yield sequentially for each key and value present in the map. If yield returns false, range stops the iteration. The map can be mutated duri
map.go:667
↓ 7 callers
Function
New
New constructs a new Map with the specified initial capacity. If initialCapacity is 0 the map will start out with zero capacity and will grow on the f
map.go:322
↓ 7 callers
Function
h1
Extracts the H1 portion of a hash: the 57 upper bits.
map.go:1634
↓ 7 callers
Function
makeProbeSeq
(hash uintptr, mask uint32)
map.go:1615
↓ 7 callers
Method
matchEmpty
matchEmpty returns the set of slots in the group that are empty.
map.go:1506
↓ 7 callers
Method
next
()
map.go:1623
↓ 6 callers
Method
toBuiltinMap
toBuiltinMap returns the elements as a map[K]V. Useful for testing.
map_test.go:42
↓ 5 callers
Method
Delete
Delete deletes the entry corresponding to the specified key from the map. It is a noop to delete a non-existent key.
map.go:576
↓ 5 callers
Method
Slice
Slice returns a Go slice akin to slice[start:end] for a Go builtin slice.
map.go:1683
↓ 5 callers
Function
makeUnsafeSlice
(s []T)
map.go:1664
↓ 5 callers
Method
removeFirst
removeFirst removes the first set bit (that is, resets the least significant set bit to 0).
map.go:1454
↓ 5 callers
Method
resize
resize the capacity of the table by allocating a bigger array and uncheckedPutting each element of the table into the new array (we know that no inser
map.go:1087
↓ 4 callers
Function
bucketStep
bucketStep is the number of buckets to step over in the buckets directory to reach the next different bucket. A bucket occupies 1 or more contiguous e
map.go:882
↓ 4 callers
Method
capacity
capacity returns the total capacity of all map buckets.
map.go:721
↓ 4 callers
Function
fastrand64
go:linkname fastrand64 runtime.fastrand64
runtime_go1.20.go:32
↓ 4 callers
Method
init
(m *Map[K, V], newCapacity uint32)
map.go:1062
↓ 4 callers
Method
installBucket
installBucket installs a bucket into the buckets directory, overwriting every index in the range of entries the bucket occupies.
map.go:897
↓ 4 callers
Method
matchEmptyOrDeleted
matchEmptyOrDeleted returns the set of slots in the group that are empty or deleted.
map.go:1519
↓ 4 callers
Method
matchH2
matchH2 returns the set of slots which are full and for which the 7-bit hash matches the given value. May return false positives.
map.go:1492
↓ 4 callers
Function
unsafeCtrlGroup
TODO(peter): - Add metamorphic tests that cross-check behavior at various bucket sizes. - Add fuzz testing. unsafeCtrlGroup reintreprets the given sli
map_test.go:37
↓ 3 callers
Method
Init
Init initializes a Map with the specified initial capacity. If initialCapacity is 0 the map will start out with zero capacity and will grow on the fir
map.go:335
↓ 3 callers
Method
String
()
map.go:1458
↓ 3 callers
Method
close
(allocator Allocator[K, V])
map.go:984
↓ 3 callers
Method
mutableBucket
(h uintptr)
map.go:743
↓ 3 callers
Method
randElement
TODO(peter): Extracting a random element might be generally useful. Should this be promoted to the public API? Note that the elements are not selected
map_test.go:55
↓ 3 callers
Method
rehashInPlace
(m *Map[K, V])
map.go:1242
↓ 3 callers
Method
resetGrowthLeft
()
map.go:1331
↓ 3 callers
Method
tombstones
tombstones returns the number of deleted (tombstone) entries in the bucket. A tombstone is a slot that has been deleted but is still considered occupi
map.go:997
↓ 3 callers
Method
uncheckedPut
uncheckedPut inserts an entry known not to be in the table. Used by Put after it has failed to find an existing entry to overwrite duration insertion.
map.go:1004
↓ 2 callers
Method
Clear
Clear deletes all entries from the map resulting in an empty map.
map.go:631
↓ 2 callers
Method
Free
Free can optionally release the memory associated with the supplied slice that is guaranteed to have been allocated by Alloc.
options.go:66
↓ 2 callers
Method
SetEmpty
SetEmpty sets all the control bytes to empty.
map.go:1486
↓ 2 callers
Function
adjustBucketIndex
adjustBucketIndex adjusts the index of a bucket to account for the growth of the directory where index was captured at originalGlobalDepth and we're c
map.go:891
↓ 2 callers
Method
convertNonFullToEmptyAndFullToDeleted
convertNonFullToEmptyAndFullToDeleted converts deleted control bytes in a group to empty control bytes, and control bytes indicating full slots to del
map.go:1532
↓ 2 callers
Method
goFormat
(w io.Writer)
map.go:1417
↓ 2 callers
Method
growDirectory
growDirectory grows the directory slice to 1<<newGlobalDepth buckets. Grow directory returns the new index location for the bucket specified by index.
map.go:907
↓ 2 callers
Function
normalizeCapacity
normalizeCapacity rounds capacity to the next power of 2.
map.go:315
↓ 2 callers
Method
split
split divides the entries in a bucket between the receiver and a new bucket of the same size, and then installs the new bucket into the buckets direct
map.go:1121
↓ 1 callers
Method
Alloc
Alloc should return a slice equivalent to make([]Group, n).
options.go:62
↓ 1 callers
Method
Close
Close closes the map, releasing any memory back to its configured allocator. It is unnecessary to close a map using the default allocator. It is inval
map.go:404
↓ 1 callers
Method
Get
Get returns the i-th control byte.
endian_big.go:25
↓ 1 callers
Method
apply
(m *Map[K, V])
options.go:22
↓ 1 callers
Method
bucket
bucket returns the bucket corresponding to hash value h.
map.go:731
↓ 1 callers
Method
fullGroups
TODO(peter): Should this be removed? It was useful for debugging a performance problem with BenchmarkGetMiss.
map.go:1349
↓ 1 callers
Method
rehash
(m *Map[K, V])
map.go:1031
Method
Alloc
(n int)
options.go:71
Method
Alloc
(n int)
map_test.go:459
Method
At
At returns a pointer to the element at index i. The go:nocheckptr declaration is need to silence the runtime check in race builds that the memory for
map.go:1677
Function
BenchmarkMapGetHit
(b *testing.B)
bench_test.go:35
Function
BenchmarkMapGetMiss
(b *testing.B)
bench_test.go:48
Function
BenchmarkMapIter
(b *testing.B)
bench_test.go:26
Function
BenchmarkMapPutDelete
(b *testing.B)
bench_test.go:100
Function
BenchmarkMapPutGrow
(b *testing.B)
bench_test.go:61
Function
BenchmarkMapPutPreAllocate
(b *testing.B)
bench_test.go:74
Function
BenchmarkMapPutReuse
(b *testing.B)
bench_test.go:87
Method
Free
(_ []Group[K, V])
options.go:75
Method
Free
(_ []Group[K, V])
map_test.go:464
Method
Get
Get returns the i-th control byte.
endian_little.go:25
Method
GoString
GoString implements the fmt.GoStringer interface which is used when formatting using the "%#v" format specifier.
map.go:704
Method
Lock
Lock is a no-op used by -copylocks checker from `go vet`.
map.go:1710
Method
Set
Set sets the i-th control byte.
endian_little.go:30
Method
String
()
map.go:1556
Method
String
()
map.go:1629
Function
TestAllocator
(t *testing.T)
map_test.go:468
Function
TestBasic
(t *testing.T)
map_test.go:212
Function
TestClear
(t *testing.T)
map_test.go:426
Function
TestConvertNonFullToEmptyAndFullToDeleted
(t *testing.T)
map_test.go:163
Function
TestDeleteAll
(t *testing.T)
map_test.go:371
Function
TestInitialCapacity
(t *testing.T)
map_test.go:186
Function
TestIterateDelete
(t *testing.T)
map_test.go:385
Function
TestIterateMutate
(t *testing.T)
map_test.go:348
Function
TestIterateTerminatesEarly
(t *testing.T)
map_test.go:408
Function
TestMatchEmpty
(t *testing.T)
map_test.go:112
Function
TestMatchEmptyOrDeleted
(t *testing.T)
map_test.go:138
Function
TestMatchH2
(t *testing.T)
map_test.go:100
Function
TestProbeSeq
(t *testing.T)
map_test.go:65
Function
TestRandom
(t *testing.T)
map_test.go:287
Function
TestResizeVsSplit
(t *testing.T)
map_test.go:487
Method
Unlock
()
map.go:1711
Function
WithAllocator
WithAllocator is an option for specifying the Allocator to use for a Map[K,V].
options.go:87
Function
WithHash
WithHash is an option to specify the hash function to use for a Map[K,V].
options.go:34
Function
WithMaxBucketCapacity
WithMaxBucketCapacity is an option to specify the max bucket size to use for a Map[K,V]. Specifying a very large bucket size results in slower resize
options.go:49
Method
apply
(m *Map[K, V])
options.go:29
Function
benchmarkRuntimeMapGetHit
( b *testing.B, n int, genKeys func(start, end int) []T, )
bench_test.go:255
Function
benchmarkRuntimeMapGetMiss
( b *testing.B, n int, genKeys func(start, end int) []T, )
bench_test.go:206
Function
benchmarkRuntimeMapIter
(b *testing.B, n int, genKeys func(start, end int) []T)
bench_test.go:169
next →
1–100 of 113, ranked by callers