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

Use atomic operations for single value counters #418

Merged
merged 1 commit into from
Nov 9, 2023
Merged

Conversation

gammazero
Copy link
Collaborator

@gammazero gammazero commented Nov 8, 2023

This is much faster than using mutexes when used for single values. When synchronizing single values, generally atomic variables are preferred.

This is much faster than using mutexes when used for single values.
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2d540e3) 74.02% compared to head (f549d4a) 73.90%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   74.02%   73.90%   -0.12%     
==========================================
  Files         149      149              
  Lines        9823     9816       -7     
==========================================
- Hits         7271     7255      -16     
- Misses       1802     1808       +6     
- Partials      750      753       +3     
Files Coverage Δ
service/dealtracker/countreader.go 82.35% <100.00%> (-5.15%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gammazero gammazero requested a review from rvagg November 8, 2023 04:01
@gammazero gammazero merged commit e309a97 into main Nov 9, 2023
@gammazero gammazero deleted the atomic-counters branch November 9, 2023 17:48
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