Allegro is a fast, disk-efficient alternative to composer install. It uses a content-addressable store (CAS) to deduplicate PHP packages across projects and links them into vendor/ via reflink, hardlink, or copy.
Allegro is not a Composer replacement — it's a Composer accelerator. Composer handles dependency resolution; Allegro handles the file I/O.
Why Allegro?
Problem
Allegro's Solution
vendor/ is 100-200 MB per project
Shared CAS — install once, link everywhere
composer install re-downloads cached packages
CAS skip — already-stored packages are linked in ~1s
10 projects = 1-2 GB of duplicated files
Hardlink/reflink deduplication across projects
Slow CI/CD vendor rebuilds
Warm CAS installs in ~1 second
Quick Start
# Install via Go
go install github.com/allegro-php/allegro/cmd/allegro@latest
# Or build from source
go build -o allegro ./cmd/allegro
# Install dependencies (reads composer.lock, downloads via CAS, links into vendor/)
allegro install
# No lock file? Allegro generates one via Composer automatically
allegro install
# Add a package (delegates resolution to Composer, installs via CAS)
allegro require guzzlehttp/guzzle ^7.0
# Update all dependencies
allegro update
# Production deploy (lock file must exist, no dev deps, no scripts)
allegro install --frozen-lockfile --no-dev --no-scripts
Benchmark
Speed
Measured on Apple M-series (macOS, APFS). Run ./benchmark/run.sh to reproduce.
Scenario
Project
Composer
Allegro
Speedup
Warm cache, no vendor
Laravel (106 pkgs)
4.68s
1.14s
4.1x
Warm cache, no vendor
Koel (194 pkgs)
8.53s
2.43s
3.5x
Warm cache, no vendor
Matomo (85 pkgs)
3.90s
1.69s
2.3x
Warm cache, no vendor
Spryker (1574 pkgs)
106s
23s
4.6x
Noop (vendor up-to-date)
Laravel
0.41s
0.03s
14x
Noop (vendor up-to-date)
Spryker
3.96s
0.05s
79x
Cold installs are network-bound so both tools perform similarly. The real advantage is on subsequent installs: Allegro skips downloads entirely and links from the local CAS.
Disk Savings
With hardlinks, multiple projects sharing the same dependencies use a single copy on disk. Run ./benchmark/disk-savings.sh to reproduce.
Setup
Disk Usage
Savings
10 × Laravel with Composer
773 MB
—
10 × Laravel with Allegro (shared CAS)
84 MB
89%
The CAS stores each file once by SHA-256 hash. Every project's vendor/ hardlinks to the same inodes — no duplication.
allegro install
1. Read composer.lock (or generate it via Composer if absent)
2. Check which packages are already in CAS — skip those
3. Download missing packages in parallel (8 workers default)
4. Extract and store in CAS (~/.allegro/store/) by SHA-256 hash
5. Link into vendor/ via reflink → hardlink → copy fallback
6. Run composer dumpautoload --optimize
7. Run Composer scripts (post-install-cmd)
8. Register project for smart store pruning
Commands
Command
Description
allegro install
Install from composer.lock
allegro update [pkg...]
Re-resolve dependencies and install
allegro require <pkg> [constraint]
Add a package
allegro remove <pkg>
Remove a package
allegro status
Show vendor state (with colored diff when outdated)
allegro verify [--fix]
Check vendor integrity against CAS
allegro store status
Show CAS statistics and registered projects
allegro store prune [--gc]
Clean orphaned files (--gc for project-aware cleanup)
go test ./... # all tests
go test -race ./... # with race detector
go test -v ./qa/... # QA test suite (92 tests)
Tested With
Allegro is QA-tested against real-world projects spanning the PHP ecosystem. Every install is verified for file integrity (hash + permissions) and autoloader correctness.