Enable parallel checkout for faster worktree creation
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Successful in 18s
CI / Test (push) Failing after 1m19s
CI / Lint (push) Successful in 18s
CI / Integration Tests (push) Successful in 1m2s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled

Add EnableParallelCheckout() helper to git package and call it when
creating bare repos. This configures checkout.workers=0 (auto-detect
cores) and checkout.thresholdForParallelism=100.

Expected 2-8x speedup on SSD for large repos (e.g., java rig with 85k files).
Based on research in hq-dqc7t (APFS CoW optimization).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 16:28:58 -08:00
committed by John Ogle
parent 2f9604620f
commit 4ed3e983f6
2 changed files with 30 additions and 7 deletions

View File

@@ -13,8 +13,8 @@ import (
"github.com/steveyegge/gastown/internal/beads"
"github.com/steveyegge/gastown/internal/claude"
"github.com/steveyegge/gastown/internal/constants"
"github.com/steveyegge/gastown/internal/config"
"github.com/steveyegge/gastown/internal/constants"
"github.com/steveyegge/gastown/internal/git"
)
@@ -342,6 +342,13 @@ func (m *Manager) AddRig(opts AddRigOptions) (*Rig, error) {
fmt.Printf(" ✓ Created shared bare repo\n")
bareGit := git.NewGitWithDir(bareRepoPath, "")
// Enable parallel checkout for faster worktree creation on large repos.
// This is especially beneficial for repos with 10k+ files (e.g., java rig).
if err := bareGit.EnableParallelCheckout(); err != nil {
// Non-fatal: parallel checkout is an optimization, not required
fmt.Printf(" Warning: could not enable parallel checkout: %v\n", err)
}
// Determine default branch: use provided value or auto-detect from remote
var defaultBranch string
if opts.DefaultBranch != "" {