ARCH-003 recommended Build Performance
Build Performance
Builds complete quickly - under 3 minutes clean, under 30 seconds cached
Question to ask
"How long does your CI take — and is anyone bothered?"
What to check
- ☐ Build caching configuration (Turbo, Nx, Webpack cache)
- ☐ CI caching (GitHub Actions cache, node_modules)
- ☐ Actual build time measurement
Pass criteria
- ✓ Clean build < 3 minutes
- ✓ Cached build < 30 seconds
- ✓ Build caching configured
- ✓ No unnecessary rebuilds
Verification guide
Severity: Recommended
Builds should be fast: under 3 minutes for clean builds, under 30 seconds with caching. Slow builds hurt developer productivity and CI costs.
Check automatically:
- Check for build caching configuration:
# Turborepo (monorepo caching)
ls -la turbo.json 2>/dev/null
grep -E "\"turbo\"" package.json 2>/dev/null
# Nx (monorepo caching)
ls -la nx.json 2>/dev/null
grep -E "\"nx\"" package.json 2>/dev/null
# Vite/esbuild/swc (fast by design)
grep -E "\"vite\"|\"esbuild\"|\"@swc\"" package.json 2>/dev/null
# Webpack caching configuration
grep -rE "cache.*filesystem|cache.*type.*filesystem" webpack.config.* 2>/dev/null
# Next.js (has built-in caching)
grep -E "\"next\":" package.json 2>/dev/null
- Check CI caching:
# GitHub Actions cache
grep -rE "actions/cache|cache:" .github/workflows/ 2>/dev/null
# Node modules / pnpm store caching
grep -rE "node_modules|pnpm-store|\.npm|\.pnpm" .github/workflows/ 2>/dev/null
# Build output caching
grep -rE "\.next|dist|build|\.turbo" .github/workflows/ 2>/dev/null
- Check build scripts:
# What does the build command do?
grep -E "\"build\":" package.json 2>/dev/null
# Check for build optimization flags
grep -rE "NODE_ENV=production|--minify|--sourcemap" package.json Makefile 2>/dev/null
- Check recent CI build times (if GitHub Actions):
# Get recent workflow runs with duration
gh run list --limit 10 --json databaseId,displayTitle,conclusion,createdAt,updatedAt 2>/dev/null
Measure actual build times (use subagent):
- Run clean build (delete node_modules/.next/.turbo/dist first)
- Time the build:
time pnpm buildor equivalent - Run cached build (second run without cleaning)
- Time again and compare
Benchmarks:
| Metric | Good | Acceptable | Needs Work |
|---|---|---|---|
| Clean build | < 2 min | < 3 min | > 5 min |
| Cached build | < 15 sec | < 30 sec | > 1 min |
| CI build | < 3 min | < 5 min | > 10 min |
Ask user:
- "How long does a typical build take?"
- "Is build caching configured?"
- "Are developers waiting on builds frequently?"
Cross-reference with:
- DEPLOY-003 (CI build performance - same concept, deployment context)
- Section 2 (Dependencies - fewer deps = faster builds)
- DEP-007 (Turborepo for monorepos - caching solution)
Pass criteria:
- Clean build completes in < 3 minutes
- Cached/incremental build completes in < 30 seconds
- Build caching is configured (local and/or CI)
- No unnecessary rebuilds of unchanged code
Partial pass:
- Build times acceptable but no caching configured
- Caching configured but not optimized (cache misses common)
- Local builds fast but CI builds slow
Fail criteria:
- Clean build > 5 minutes
- No caching configured (every build is full rebuild)
- Cached build still takes minutes
- Developers avoid running builds due to slowness
- CI times consistently > 10 minutes
Evidence to capture:
- Measured clean build time
- Measured cached build time
- Caching tools in use (Turbo, Nx, Webpack cache, etc.)
- CI build times (from recent runs)
- Any identified bottlenecks