Replace fastrand with rand/v2 package - #8534
Conversation
|
Please review the To correct, please amend the following commits and force-push: |
81877d6 to
dff7387
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81877d6647
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
dff7387 to
dbca1e5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbca1e5481
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
dbca1e5 to
2db437f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2db437fb6d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Amirali Amirifar <amirali.amirifar@gmail.com>
2db437f to
9e81198
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e811988b1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| filters := make([]string, 0, bc.filters) | ||
| for len(filterDomains) < bc.filters { | ||
| domain := domains[rng.Intn(len(domains))] | ||
| domain := domains[rand.IntN(len(domains))] |
There was a problem hiding this comment.
Keep concurrent filter selection deterministically seeded
When this benchmark runs multiple consumer goroutines, selecting domains through the package-level generator makes each consumer's filter set depend on goroutine scheduling and vary between runs. Because overlap among concurrent consumers changes how many consumers process the same subjects, benchmark deltas can reflect a different concurrent workload rather than the code under test. Preserve the previous per-consumer RNG behavior by creating a locally seeded ChaCha8 generator from seed + consumerId and passing it into this helper.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Is it really significant? does it require deterministic run?
This pull request replaces the internal fastrand package with Go's standard library math/rand/v2.
The changes:
This follows the approach taken by other Go projects, such as CockroachDB Pebble Which is the origin of this fastrand package cockroachdb/pebble#4018