Performance baseline and optimization tracking for the bfra.me/works monorepo.
| Metric | Target | Status |
|---|---|---|
pnpm validate (local) |
< 2 minutes | 🔄 Measuring |
pnpm build (full) |
< 45 seconds | 🔄 Measuring |
pnpm build (incremental) |
< 5 seconds | 🔄 Measuring |
pnpm test |
< 30 seconds | 🔄 Measuring |
pnpm lint |
< 20 seconds | 🔄 Measuring |
pnpm analyze |
< 10 seconds | 🔄 Measuring |
| CI pipeline (total) | < 5 minutes | 🔄 Measuring |
Problem: Development cache key included **/*.ts which invalidated all caches on any TypeScript file change (tests, docs, fixtures).
Solution: Narrowed cache pattern to packages/*/src/**/*.ts and added dedicated ESLint cache with its own key pattern.
Files Changed:
.github/actions/pnpm-install/action.yaml
Expected Impact: 50-70% improvement in cache hit rate
Problem: pnpm validate ran all steps sequentially: type-check → build → lint → test → type-coverage
Solution: Run type-check, lint, and test concurrently (they have no dependencies due to vitest's conditions: ['source'] resolver), then build and type-coverage sequentially.
Before:
type-check → build → lint → test → type-coverage
[sequential, ~2-3 minutes]
After:
┌─────────────┬─────────┬──────┐
│ type-check │ lint │ test │ (parallel)
└─────────────┴─────────┴──────┘
↓
build
↓
type-coverage
Files Changed:
package.json(validate script)
Expected Impact: 30-40% reduction in validate time
Problem: analyze job waited for build to complete unnecessarily.
Solution: Changed analyze to depend on prepare instead of build. Workspace-analyzer scans source files, not build artifacts.
Files Changed:
.github/workflows/main.yaml
Expected Impact: 10-15% reduction in CI wall-clock time
TIMING=1 pnpm build 2>&1 | grep -E 'packages|total|✓'pnpm test -- --reporter=verbosetime pnpm linttime pnpm analyzetime pnpm validatepnpm tsc --noEmit --diagnostics- Location: pnpm store path
- Rotation: Monthly (year-month based key)
- Invalidates on:
pnpm-lock.yamlchanges
- Location:
.tsup/,tsconfig.tsbuildinfo,.type-coverage/,docs/.astro/ - Invalidates on: Source code changes (
packages/*/src/**/*.ts) - Safe to delete: Yes, triggers full rebuild
- Location:
.eslintcache - Invalidates on: ESLint config or source changes
- Safe to delete: Yes, next lint run recreates it
- Check if ESLint cache exists:
ls -la .eslintcache - Check tsup cache:
ls -la packages/*/.tsup - Clean and rebuild:
pnpm clean && pnpm build
- Check cache hit/miss in GitHub Actions logs
- Verify cache key patterns match expected files
- Force cache refresh by incrementing version in cache key
- Profile with:
pnpm test -- --reporter=verbose - Check for large fixture files or slow setup
- Ensure
it.concurrent()used for independent tests
- Implement task-level build caching (Turbo or manual)
- Add test sharding across multiple CI runners
- Incremental workspace-analyzer with change detection
- Optimize eslint-config type generation caching