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

Improved computation of items/minute and time remaining #55

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Conversation

dpp
Copy link
Contributor

@dpp dpp commented Feb 4, 2025

💻 Description of Change(s) (w/ context)

Improved computation of items/minute and time remaining

🧠 Rationale Behind Change(s)

Improve observability

📝 Test Plan

passes tests

📜 Documentation

💣 Quality Control

(All items must be checked before a PR is merged)
Did you…

  • Mention an issue number in the PR title?
  • Update the version # in the build file?
  • Create new and/or update relevant existing tests?
  • Create or update relevant documentation and/or diagrams?
  • Comment your code?
  • Fix any stray verbose logging (removing, or moving to debug / trace level)?

Before Merging…

  • Make sure the Quality Control boxes are all ticked
  • Make sure any open comments or conversations on the PR are resolved

@dpp dpp requested review from aredridel and earldouglas February 4, 2025 14:32
Copy link
Contributor

@aredridel aredridel left a comment

Choose a reason for hiding this comment

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

Makes sense, and TIL @volatile. I don't think there's any interesting data race if it were omitted but it's correct.

@dpp
Copy link
Contributor Author

dpp commented Feb 4, 2025

@volatile for a Boolean may not be a huge issue... but we are all running multi-processor boxes with non-uniform memory access. It's likely the the Boolean may be seen differently between CPUs depending on cache where @volatile ensures cache coherence. But the cost of this one being wrong is quite low.

@volatile for the Instant is important. Depending on processor type and memory access patterns, 64 bit pointer writes may be atomic and they may be broken into 2 32 bit writes. Ensuring the atomic write for the Instant reference is necessary.

@dpp dpp merged commit 2661aad into main Feb 4, 2025
2 checks passed
@dpp dpp deleted the better_timing branch February 12, 2025 13:18
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