Repository navigation
perf(config): avoid duplicate git lookups in vp config hook setup - #3501
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82fd0eb535
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
vp configusually runs from apreparescript, so it runs on every install. When the hooks were already installed and nothing changed, it still started 15 git processes, and 5 of them repeated an earlier lookup.config/bin.tsresolved the hooks location and checked the disable preference, and theninstall()did both again.Fix
install()accepts an already-resolvedlocation.vp configpasses the location it resolved and skips the second preference check, because it has already checked the preference.enable()had the same double lookup and now passes its location too.getGitWorktree()reads the worktree root and the prefix with onegit rev-parse --show-toplevel --show-prefixcall instead of two.--get-allchecks before each config write are unchanged, because they let concurrent runs in linked worktrees skip writes that would contend forconfig.lock.Benchmark
Measured on macOS in a Git repository with a
package.jsonand the hooks already installed, so every measured run is the no-change case.--no-agentskips the agent instructions step, which this change does not touch, so the timing covers only the hooks setup. Hyperfine compared the merge base5b0f891f9with this PR over 20 runs each, after 3 warmup runs.vp config --no-agentHyperfine output
hyperfine result for
vp config --no-agent