refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)>#1445
Conversation
`group_by_scope` in `queue status` returned `IndexMap<String, Vec<&Batch>>` because the human renderer needs first-seen insertion order (mirrors Python dict iteration). That's one hashmap-shaped use of the only `IndexMap` in the codebase — and the typical input size is 1–3 scopes per repo. At that N, the hashing/bucketing overhead of `IndexMap` is dead weight versus a `Vec<(K, V)>` with a linear `iter_mut().find()` on insert. Same wire shape from the caller's side (still iterable by `(scope, batches)`), one fewer crate in `Cargo.lock`. `indexmap` survives transitively (it's an internal dep of `jsonschema`), so the lockfile loses one direct line but keeps the package — that's fine, the goal here is to shed a *direct* dependency we control, not to fight upstream graphs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Change-Id: I7085cf297a6a294217b0a6656a4bc224a1dd2c58
This was referenced May 19, 2026
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced May 19, 2026
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 ⛓️ Depends-On RequirementsWaiting for
This rule is failing.Requirement based on the presence of
🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
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.
group_by_scopeinqueue statusreturnedIndexMap<String, Vec<&Batch>>because the human renderer needs first-seeninsertion order (mirrors Python dict iteration). That's one
hashmap-shaped use of the only
IndexMapin the codebase — andthe typical input size is 1–3 scopes per repo.
At that N, the hashing/bucketing overhead of
IndexMapis deadweight versus a
Vec<(K, V)>with a lineariter_mut().find()on insert. Same wire shape from the caller's side (still iterable
by
(scope, batches)), one fewer crate inCargo.lock.indexmapsurvives transitively (it's an internal dep ofjsonschema), so the lockfile loses one direct line but keeps thepackage — that's fine, the goal here is to shed a direct
dependency we control, not to fight upstream graphs.
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1444