# V2 Large Repository Performance

This guide covers `TODOS.phase-72.72.20.1.13`: sparse checkout, partial clone,
and Git LFS batch API tuning for the V2 asset repository.

## Source Of Truth

- Manifest: `V2/ue/Build/AssetPipeline/v2-large-repo-performance.json`
- Tool: `V2/ue/Tools/v2_large_repo_performance.py`
- Validator: `V2/ue/Tools/check-v2-large-repo-performance.py`
- Report: `V2/ue/Saved/CI/LargeRepoPerformanceReport.json`

## Profiles

Generate a profile plan for an artist workstation:

```bash
python3 V2/ue/Tools/v2_large_repo_performance.py profile \
  --profile artist \
  --repo-url git@github.com:GreyChimp/oshun.git \
  --workspace ~/OshunV2Artist
```

The artist and CI profiles use `GIT_LFS_SKIP_SMUDGE=1`, `--filter=blob:none`,
cone-mode sparse checkout, and `git lfs fetch --recent`. They explicitly avoid
`git lfs fetch --all`.

## Sparse Checkout

The default artist sparse roots are `V2/ue`, `V2/docs/asset-pipeline`, and
`TODOS/phase-72.md`. CI adds `.github/workflows` so workflow and checker changes
can be validated without expanding the entire monorepo. Release operators get
`V2/ue`, all `V2/docs`, and the phase checklist.

## LFS Batch API Tuning

All profiles configure the LFS batch API, TUS transfers, eight concurrent
transfers, 60-second activity and keep-alive timeouts, and recent-ref fetch
windows. Artists use a 7-day recent-ref window; CI uses 30 days to cover queued
merge and release validation.

## Git Maintenance

Profile plans also enable `feature.manyFiles`, `core.untrackedCache`, repository
maintenance registration, commit-graph generation with changed paths, and
multi-pack-index bitmaps. These settings keep status, history walks, and fetch
negotiation usable as binary asset history grows.

## Validation Commands

```bash
python3 V2/ue/Tools/v2_large_repo_performance.py self-test
python3 V2/ue/Tools/v2_large_repo_performance.py audit \
  --json-report V2/ue/Saved/CI/LargeRepoPerformanceReport.json
python3 V2/ue/Tools/check-v2-large-repo-performance.py
python3 -m json.tool V2/ue/Build/AssetPipeline/v2-large-repo-performance.json
python3 V2/ue/Tools/check-v2-ci-workflow.py
```
