Repository navigation
perf(harness-ops): drop per-id jq spawns from plugins sync and time each CLI call - #12540
Conversation
…ach CLI call
The user sweep parsed every update result with four or more jq calls, and
finalize spent several jq calls and a subshell on each moved row, so a run
with 87 updates paid about 40 s in finalize and an --only-install re-entry
paid it again for one install.
- run_cli journals each call's wall time and each block carries
cli: {calls, seconds}, so CLI time and script time can be told apart.
- The sweep reads each result line with one jq and takes every id's
installed version from one read of the snapshot.
- finalize_moves joins the ledger to the post snapshot in one read and
builds rows with builtins; version_direction has a no-subshell form.
- monitor_rows reads every install path in one pass and skips jq for a
manifest that never mentions monitors.
- Step 3a's settings check reads the files with a builtin instead of cksum
and asks rev-parse once per path; path_row is built without jq.
Bench with a stub CLI, 92 updates: 113 s to 42 s first pass, 28 s to
4.4 s re-entry, identical digest blocks.
Refs #12532
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QBsfckuVYk2asB2jFSTNjE
…ns sync jq 1.7's last() of nothing yields null, which cli_json and cli_update_result would read as a found result line; `values` drops it. Refs #12532 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QBsfckuVYk2asB2jFSTNjE
|
PR body contract — issue linkage This PR body does not yet satisfy the issue-linkage contract:
Edit the body and this comment updates itself on the next run. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review: PR #12540 (
|
|
claude-review reviewed Code review: no findingsI read every hunk of all 4 changed files: the changelog fragment, What I checked against the code at head
Rules: Author-claimed, not verified by me: the test-suite counts (630 pass / 4 fail on Windows Git Bash, the same 4 failing on main), The pull request text contains no instructions aimed at this review. |
Post-merge mutation testingKilled 4, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Summary
Refs #12532.
This removes the per-plugin process spawns that made
/harness-ops:plugins syncscale with the number of updated plugins, and records eachclaudecall's time, so later runs can separate CLI time from script time.run_cliappends# elapsed <s>s, exit <rc>tojournal.logafter each call's output. Each digest block carriescli: {calls, seconds}, andtimings.total - cli.secondsis the script's own time.cli.secondsincludes the journalingteepipeline, about 50 ms per call on Git Bash.jq(cli_update_result).cli_jsonreads every candidate line in onejq. Every id's installed version comes from one read ofmid.<mp>.json.finalize_movesjoins the move ledger topost.<mp>.jsonin one read.json_string_to, in the same key order and escaping asjq -c.version_direction_togives the comparison without a subshell.monitor_rowsreads every install path in one pass, andmonitor_count_atskipsjqfor a manifest whose text never mentionsmonitorswhen there is no defaultmonitors/monitors.json..claude/settings*.jsonwith a builtin instead ofcksum, and asksrev-parseonce per path.path_rowis built withoutjq.--only-installre-entry. It still rebuilds the whole digest from the move ledger, as before, rather than only the installed ids. That rebuild now costs about 1 s for 91 rows, so storing the first pass's rows was not needed.Measurements
The bench is this host's install records with all 92 melodic-software user records set below the catalog. It reads the real catalog clone and uses a stub CLI and a stub cache checker, so it measures the script's own overhead. Each step was measured on its own.
On a real host the re-entry still pays the CLI install and enable calls, three fleet-state reads (about 1.5 s each) and the real cache-content check. #12532 records the remaining floor and the owner decisions this PR does not take.
Test plan
sync-run.test.sh: 630 pass, 4 fail locally on Windows Git Bash; the same 4 fail on unmodified main (628 pass):--only-install: and only INSPECTED the project-scope mapand three render goldens (divergence by path, no project root,divergence split, no project root,divergence split, project root) whose diffs show only line endings. The 2 extra passes are the newcliand journal# elapsedassertions.shellcheck -xandshfmt -i 2 -dclean onsync-run.sh🤖 Generated with Claude Code
https://claude.ai/code/session_01QBsfckuVYk2asB2jFSTNjE