Conversation
`river bench` intends to give every inserted job a unique `num` arg,
but its insert loops range over the args batch by value and increment
`Num` on a copy. The batch itself is never modified, so every job it
inserts carries `num: 0`.
Replace the separate args batch with a small helper that writes a
fresh `BenchmarkArgs{Num: ...}` into each insert params element and
returns the last number used, so numbering continues across batches.
Both the fixed-count and continuous insert modes share the helper. The
extra args slice didn't save any allocations anyway because each
`BenchmarkArgs` value was boxed into the `Args` interface on
assignment.
Add a test that runs the fixed-count insert path across two batches
and checks that the inserted jobs are numbered `1..N`.
bgentry
force-pushed
the
bg/bench-job-numbers
branch
from
September 24, 2026 17:35
4b7c006 to
52b3880
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
river benchis meant to give each inserted job a uniquenumarg, but the insert loops setNumon a copy of each batch element, so every job goes in asnum: 0.This replaces the separate args batch with a helper that writes a numbered
BenchmarkArgsstraight into each insert-params element and continues the count from one batch to the next. Both the fixed-count and continuous insert modes use it. A new test runs the fixed-count insert path across two batches and checks the inserted jobs are numbered from 1 to N.