Maintenance, repository lớn và CI
Tối ưu bằng số đo clone/fetch/status/build; đừng dùng một kỹ thuật cho mọi bottleneck.
Đo đúng lớp
Clone time gồm ref advertisement, negotiation, transfer, index/checkout. Status phụ thuộc working tree/index/filesystem. Build phụ thuộc dependency graph và cache. Dùng Trace2, count-objects -vH, timings và server metrics để tìm lớp chậm.
Maintenance
git maintenance chạy commit-graph, loose-objects, incremental-repack, gc hoặc prefetch tùy strategy. Lập lịch tránh contention; theo dõi disk headroom. Server cần policy khác developer clone.
CI caching
Cache object database có thể giảm transfer nhưng cần isolation theo trust, locking, integrity checks và clean-fetch fallback. Không cache credentials. Shallow clone nhanh nhưng có thể làm versioning/diff-base sai; fetch đủ base theo job semantics.
Architecture
Monorepo cần sparse/partial, affected graph, build cache và ownership. Split repo tăng coordination/versioning overhead; chỉ tách khi lifecycle, security hoặc ownership boundary đủ mạnh.