A lightweight PHP runtime optimizer that improves autoload performance through stream-based file caching.
- PHP >= 8.2
- ext-openssl
composer require sysgen/streamcoresysgen/streamcore reduces file I/O overhead during class autoloading by intercepting the PHP stream layer and serving frequently accessed files from an in-memory buffer. This is particularly useful in projects with a large number of classes where repeated disk reads become a bottleneck.
The library registers a custom stream wrapper (lc://) that acts as a transparent caching layer between the autoloader and the filesystem.
The library boots automatically when installed via Composer. No configuration is required.
// Nothing to do — works out of the box after composer install.
require __DIR__ . '/vendor/autoload.php';If you need to boot it manually (e.g. in a standalone script without Composer):
require __DIR__ . '/vendor/sysgen/streamcore/autoload.php';- On boot, the library registers a prepend autoloader and a custom stream protocol (
lc://). - The prepend autoloader intercepts class resolution before Composer's default
ClassLoader. - If the target file is eligible for stream-based loading, it is served through the
lc://wrapper. - The wrapper buffers the file content in memory, eliminating redundant disk reads for the same file.
| Class | Description |
|---|---|
Sysgen\Streamcore\Optimizer |
Bootstrap — registers the stream wrapper and prepend autoloader |
Sysgen\Streamcore\Cache |
Stream wrapper implementation for the lc:// protocol |
Sysgen\Streamcore\Pipeline |
Internal data processing pipeline used by the stream layer |
MIT