happyr/annotation-warmer
Warms up PHP annotation caches ahead of runtime so your first request doesn't pay the parsing cost. Scans classes for annotations, primes the reader cache, and exposes an Artisan command, making it a small performance add-on for Laravel and Doctrine-based apps.
composer install --no-dev and an optimized/authoritative autoloader without shipping annotation classes that are only needed for parsing. That's a supply-chain and image-size decision, not just a latency one.Consider it only when all of these hold:
Doctrine\Common\Annotations\CachedReader / PsrCachedReader.deployer, Capistrano, CI/CD step) and you can warm the cache in the target environment.Look elsewhere — or skip entirely — when:
cache:warmup and container compilation already cover your hot path.doctrine/annotations deprecations. The runtime risk surface is small (no network or I/O at request time), but the maintenance risk is real, and 0.3.0 shows the package will make small breaking config changes on a 0.x line without migration notes — pin it, fork it, or reimplement it.To executives: A small, MIT-licensed deploy-time optimization. It pre-parses PHP docblock annotations once during deployment so production servers don't repeat that work on every cold start, and it lets us ship leaner production builds. The catch: it was dormant from 2019 until a single 0.3.0 housekeeping release, has effectively zero community, and is built on Doctrine annotations — a technology the ecosystem is actively sunsetting in favor of PHP 8 attributes. The 0.3.0 change removes default configuration, so adopting it now means owning a config file we must validate on every upgrade. Recommendation: do not adopt as a new dependency. If we have a measured cold-start problem, budget half a day to reimplement the equivalent deploy step internally, or fold the work into the attributes migration we'll need anyway.
To engineering: One console command that fills the annotation cache at deploy time. 0.3.0 removed the config defaults and added a service-definition existence check — a robustness fix, but it means 0.3.0 is not a drop-in for anyone already on 0.2.x: you must publish/supply the config explicitly, and you should diff the new expected keys against whatever your warm command reads. Nothing here adds PHP 8.2+/8.3+ support or a test matrix, so do not read this release as the project coming back to life. Before adopting, measure: cold-cache request latency and deploy-time cache rebuild cost, with and without warming. If the number is real and we're staying on annotations short-term, the source is small enough to vendor and own — which also insulates us from the next 0.x config break.
How can I help you explore Laravel packages today?