Skip to content

Conversation

analytically
Copy link
Contributor

Replace the custom map implementation with mutex-based locking with Go's built-in sync.Map for improved concurrency handling. This change simplifies the code by:

  • Eliminating the need for manual RWMutex locking
  • Removing custom load/store/delete wrapper methods
  • Simplifying the Clean method to directly delete entries during iteration
  • Reducing memory allocations by avoiding temporary slices

The functionality remains unchanged, but the implementation is now more concise and leverages Go's optimized concurrent map designed for high-read, low-write scenarios.

Replace the custom map implementation with mutex-based locking with Go's built-in
sync.Map for improved concurrency handling. This change simplifies the code by:

- Eliminating the need for manual RWMutex locking
- Removing custom load/store/delete wrapper methods
- Simplifying the Clean method to directly delete entries during iteration
- Reducing memory allocations by avoiding temporary slices

The functionality remains unchanged, but the implementation is now more concise
and leverages Go's optimized concurrent map designed for high-read, low-write
scenarios.

Signed-off-by: Mathias Bogaert <mathias.bogaert@gmail.com>
@taylorsilva taylorsilva force-pushed the beingwatchedsyncmap branch from f8db00d to 095953a Compare July 4, 2025 01:18
@taylorsilva taylorsilva merged commit 6d5b621 into concourse:master Jul 4, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Pull Requests Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants