PHPackages                             chrisnetonline/turbo-composer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chrisnetonline/turbo-composer

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

chrisnetonline/turbo-composer
=============================

Rust-powered Composer acceleration: parallel extraction + fast classmap generation

v0.2.0(2mo ago)36MITRustPHP &gt;=8.1CI passing

Since Feb 9Pushed 2mo agoCompare

[ Source](https://github.com/chrisnetonline/turbo-composer)[ Packagist](https://packagist.org/packages/chrisnetonline/turbo-composer)[ RSS](/packages/chrisnetonline-turbo-composer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

 [![Turbo Composer](logo.png)](logo.png)

turbo-composer
==============

[](#turbo-composer)

[![Release](https://github.com/chrisnetonline/turbo-composer/actions/workflows/release.yml/badge.svg)](https://github.com/chrisnetonline/turbo-composer/actions/workflows/release.yml)

Rust-powered Composer acceleration: parallel extraction, fast classmap generation, integrity verification, and vendor validation.

Features
--------

[](#features)

- **Fast classmap generation** — byte-scanning PHP tokenizer with parallel directory walking, up to 7x faster than Composer's built-in classmap generator
- **Incremental caching** — caches symbols by file mtime with directory-level cache; warm runs skip entire directory walks and vendor stat calls
- **Staged file writes** — Rust writes autoload files directly to disk with atomic rename, eliminating JSON serialization overhead for large classmaps
- **Smart parent::dump() skip** — when infrastructure files already exist from a prior install, the Composer PHP-side dump is skipped entirely on warm runs
- **Batched operations** — clean, verify, and extract operations are combined into a single Rust process invocation, reducing process spawn overhead
- **Parallel package extraction** — extracts zip/tar archives using Rust + rayon for parallel I/O
- **Parallel integrity verification** — SHA256/SHA1 hash verification of package archives, ~7x faster than PHP's `hash_file()`
- **Fast vendor state validation** — checks all packages are present in vendor/ in parallel, up to 13x faster than PHP
- **Parallel vendor cleanup** — concurrent removal of package directories during updates/uninstalls
- **Drop-in Composer plugin** — integrates transparently with `composer install` and `composer dump-autoload -o`
- **Automatic binary management** — downloads platform-specific binaries on first use

Installation
------------

[](#installation)

```
composer require chrisnetonline/turbo-composer
```

Once installed, the plugin activates automatically. Run Composer as usual:

```
composer install
composer dump-autoload --optimize
```

How it works
------------

[](#how-it-works)

turbo-composer replaces Composer's autoload generator with a Rust-accelerated version. When you run `composer dump-autoload --optimize`, it:

1. Resolves the autoloader suffix and builds the autoload payload in PHP
2. Starts the Rust engine as a background subprocess with a staging suffix (`.turbo`)
3. Rust walks all directories in parallel (two-phase: collect paths, then rayon parallel read+parse), extracts class/interface/trait/enum symbols using a single-pass byte scanner, and writes all 7 autoload files directly to disk as staged files
4. If infrastructure files (`ClassLoader.php`, `installed.php`) already exist, Composer's `parent::dump()` is skipped entirely; otherwise it runs in parallel with Rust
5. Once both complete, the staged `.turbo` files are atomically renamed to their final names

Rust generates all autoload files directly: `autoload.php`, `autoload_real.php`, `autoload_classmap.php`, `autoload_psr4.php`, `autoload_namespaces.php`, `autoload_files.php`, and `autoload_static.php`. An incremental mtime cache skips re-reading unchanged files, and vendor files skip stat calls entirely on warm runs.

During `composer install`/`update`, clean, verify, and extract operations are batched into a single Rust process invocation to minimize process spawn overhead.

Configuration
-------------

[](#configuration)

The plugin works out of the box with zero configuration. The binary version is automatically matched to the installed plugin version.

For advanced use cases (e.g., private mirrors), you can override the download URL in your project's `composer.json`:

```
{
    "extra": {
        "turbo-composer": {
            "base-url": "https://my-internal-mirror.example.com/turbo-composer/releases/download"
        }
    }
}
```

SettingDefaultDescription`base-url`GitHub releases URLOverride base URL for binary downloadsPlatform support
----------------

[](#platform-support)

PlatformArchitectureBinaryLinuxx86\_64YesLinuxaarch64YesmacOSx86\_64YesmacOSaarch64 (Apple Silicon)YesWindowsx86\_64YesDevelopment
-----------

[](#development)

### Prerequisites

[](#prerequisites)

- PHP 8.1+
- Composer 2.6+
- Rust toolchain (`cargo`, `rustc`, `clippy`) — install via [rustup](https://rustup.rs) or `brew install rust`

### Building from source

[](#building-from-source)

```
cd rust
cargo build --release
cp target/release/turbo-composer ../bin/turbo-composer
```

### PHP checks

[](#php-checks)

```
composer install

# Formatting (mago)
vendor/bin/mago fmt            # Format PHP files
vendor/bin/mago fmt --check    # Check formatting without modifying

# Linting (mago)
vendor/bin/mago lint           # Run static analysis
vendor/bin/mago lint --fix     # Auto-fix lint issues

# Unit tests (no Rust binary needed)
vendor/bin/phpunit --testsuite Unit

# Correctness tests (requires Rust binary in bin/)
vendor/bin/phpunit --testsuite Correctness

# All PHP tests
vendor/bin/phpunit
```

The **unit tests** cover `BinaryInstaller` and `RustBridge` using fake shell-script binaries — no Rust build required. The **correctness tests** generate classmaps with both vanilla Composer and turbo-composer across multiple fixtures (small, medium, large, laravel-app, symfony-app) and assert they match exactly.

### Rust checks

[](#rust-checks)

```
cd rust

cargo check              # Type-check without building
cargo test               # Run unit + integration tests
cargo clippy -- -D warnings   # Lint with clippy (warnings as errors)
```

### Benchmarks

[](#benchmarks)

```
chmod +x benchmarks/run.sh
./benchmarks/run.sh         # 3 iterations per fixture (default)
./benchmarks/run.sh 5       # 5 iterations per fixture
```

The benchmark script builds the binary if needed, creates temporary projects with varying sizes, and compares vanilla Composer vs turbo-composer (cold cache vs warm cache).

Performance
-----------

[](#performance)

### Classmap Generation (`dump-autoload --optimize`)

[](#classmap-generation-dump-autoload---optimize)

FixturePHP FilesVanillaTurbo (cold)Turbo (warm)symfony-real4,3344,917ms696ms (**7.1x**)741ms (**6.6x**)laravel-real5,5942,795ms845ms (**3.3x**)804ms (**3.5x**)monolith8,8743,886ms1,055ms (**3.7x**)1,062ms (**3.7x**)Rust writes all 7 autoload files directly to disk using a staging + atomic rename approach, eliminating JSON serialization overhead. On warm runs, `parent::dump()` is skipped when infrastructure files already exist, and the incremental mtime cache skips entire directory walks and vendor stat calls.

### Integrity Verification (SHA256)

[](#integrity-verification-sha256)

FixtureFilesRustPHPSpeedupsymfony-real20023ms169ms**7.3x**laravel-real200113ms201ms**1.8x**monolith20024ms158ms**6.6x**Parallel SHA256 hashing using Rust's `sha2` crate + rayon, vs PHP's sequential `hash_file()`.

### Vendor State Validation

[](#vendor-state-validation)

FixturePackagesRustPHPSpeedupsymfony-real70124ms214ms**1.7x**laravel-real7614ms136ms**9.7x**monolith1159ms118ms**13.1x**Parallel check that all packages from `composer.lock` are present and non-empty in vendor/. Useful for CI warm-cache validation.

Architecture
------------

[](#architecture)

```
src/
  TurboInstallerPlugin.php   # Composer plugin entry point
  TurboAutoloadGenerator.php # Extends Composer's AutoloadGenerator
  RustBridge.php             # Spawns Rust binary, communicates via JSON
  BinaryInstaller.php        # Downloads/installs platform binary

rust/src/
  lib.rs                     # Library entry (exports modules)
  main.rs                    # CLI binary entry
  classmap/                  # Classmap generation module
    mod.rs                   #   Public API + orchestrator
    parser.rs                #   PHP symbol extraction (byte scanner)
    walker.rs                #   Parallel directory walking + file parsing
    codegen.rs               #   PHP autoload file generation
    cache.rs                 #   Incremental mtime caching
  extract.rs                 # Parallel package extraction
  clean.rs                   # Parallel vendor directory cleanup
  verify.rs                  # Parallel SHA256/SHA1 integrity verification
  vendor_state.rs            # Fast vendor directory validation

```

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance83

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

85d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c5d4568c0c98f6682771c64045c1ec810479ad6002cc7397217fa9becbafbaf8?d=identicon)[chrisnetonline](/maintainers/chrisnetonline)

---

Top Contributors

[![chrisnetonline](https://avatars.githubusercontent.com/u/265868?v=4)](https://github.com/chrisnetonline "chrisnetonline (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chrisnetonline-turbo-composer/health.svg)

```
[![Health](https://phpackages.com/badges/chrisnetonline-turbo-composer/health.svg)](https://phpackages.com/packages/chrisnetonline-turbo-composer)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
