Skip to content

feat: migrate from sync.Map to xsync.Map#1394

Merged
egibs merged 1 commit intochainguard-dev:mainfrom
egibs:use-xsync-map
Feb 23, 2026
Merged

feat: migrate from sync.Map to xsync.Map#1394
egibs merged 1 commit intochainguard-dev:mainfrom
egibs:use-xsync-map

Conversation

@egibs
Copy link
Member

@egibs egibs commented Feb 23, 2026

This PR migrates from using sync.Map to xsync.Map which is generally more performant in all cases. This also has the benefit of removing most of the tedious type checking we were doing when iterating over the original maps. I've been meaning to do this for a while but the recent focus on testing debt pushed this down the list.

All of the changes test cleanly and make refresh-sample-testdata produces no drift.

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs marked this pull request as ready for review February 23, 2026 20:37
Copy link
Member

@stevebeattie stevebeattie left a comment

Choose a reason for hiding this comment

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

LGTM, I really like being able to be explicit about the map types.

This does mean that we change some APIs, do we need to double check users of malcontent as a library to make sure things still compile/work there?

@egibs
Copy link
Member Author

egibs commented Feb 23, 2026

LGTM, I really like being able to be explicit about the map types.

This does mean that we change some APIs, do we need to double check users of malcontent as a library to make sure things still compile/work there?

We should be fine in the one place that's top of mind because we're only decoding result JSON in a way that bypasses any sync.Map usage.

@egibs egibs merged commit b2c1dcd into chainguard-dev:main Feb 23, 2026
17 checks passed
@egibs egibs deleted the use-xsync-map branch February 23, 2026 22:26
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