Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change struct define of group might be improve cpu cache hit #26

Open
ahfuzhang opened this issue Nov 28, 2023 · 0 comments
Open

change struct define of group might be improve cpu cache hit #26

ahfuzhang opened this issue Nov 28, 2023 · 0 comments

Comments

@ahfuzhang
Copy link

see:

swiss/map.go

Line 42 in c0064a0

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
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant