see:
|
type group[K comparable, V any] struct { |
We always need to use both key and value, so if we put key and value togother, it might be improve cpu cache hit.
So struct group
define like this might be better:
type group[K comparable, V any] struct {
items [groupSize]struct {
key K
value V
}
}