Skip to content

pkg/proc: add GOEXPERIMENT=mapsplitgroup support#4274

Open
prattmic wants to merge 1 commit intogo-delve:masterfrom
prattmic:push-vrmypoztltwl
Open

pkg/proc: add GOEXPERIMENT=mapsplitgroup support#4274
prattmic wants to merge 1 commit intogo-delve:masterfrom
prattmic:push-vrmypoztltwl

Conversation

@prattmic
Copy link
Contributor

@prattmic prattmic commented Mar 4, 2026

https://go.dev/cl/711560 adds GOEXPERIMENT=mapsplitgroup which changes the layout of map groups from KVKVKVKV to KKKKVVVV.

This GOEXPERIMENT may or may not be enabled permanently, depending on its performance impact, but I needed delve support for some debugging, so I went ahead and implemented support.

In the map iterator we determine which layout the map is using based on the presence of keys and elems fields in the group type instead of a slots field.

https://go.dev/cl/711560 adds GOEXPERIMENT=mapsplitgroup which changes
the layout of map groups from KVKVKVKV to KKKKVVVV.

This GOEXPERIMENT may or may not be enabled permanently, depending on
its performance impact, but I needed delve support for some debugging,
so I went ahead and implemented support.

In the map iterator we determine which layout the map is using based on
the presence of keys and elems fields in the group type instead of a
slots field.
@prattmic
Copy link
Contributor Author

prattmic commented Mar 4, 2026

I'm not sure that you want to merge this yet, but I needed it for testing, so I figured I might as well send it.

cc @jakebailey

Copy link
Member

@aarzilli aarzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would need a test after the CL gets merged, more or less a copy of TestClassicMap with just the t.Setenv line changed (or better put the code of TestClassicMap in an helper function and pass in the value for GOEXPERIMENT as argument)

var err1, err2 error
it.curKey, err1 = it.group.keys.sliceAccess(int(it.slotIdx))
it.curValue, err2 = it.group.elems.sliceAccess(int(it.slotIdx))
if err1 != nil || err2 != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this outside of the if.

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

Successfully merging this pull request may close these issues.

2 participants