Download the PHP package thadafinser/speed-loader without Composer
On this page you can find all versions of the php package thadafinser/speed-loader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thadafinser/speed-loader
More information about thadafinser/speed-loader
Files in thadafinser/speed-loader
Package speed-loader
Short Description Load classes faster
License MIT
Homepage https://github.com/ThaDafinser/SpeedLoader
Informations about the package speed-loader
SpeedLoader - load only one file
One file to load all your needed classes at once!
Since autoloading takes more and more time, it has become very important to have an efficient autoloading.
SpeedLoader
aims to improve your autoloading experience
Install
Get it with composer:
Create a seperate file
Add the cache to your application
Is this something new?
No it's nothing completely new. There are a couple of solutions around, but all of them are having some problems, that's why i "reinvited the wheel".
Features
- independent
- can be used with all packages or frameworks around
- or only with your code
- different compression modes
- compression for production
- normal for development
- save the cache how you want
- you get the complete cache as a string
- e.g. save it as a file or memory
Example
Generate
Just execute the part of your application you want to cache. Dont do this in your normal process - warm up your cache with a cronjob or similar
Include the file in your final application
Why concat classes
Finding and opening a lot of files on the filesystem is expensive. (similar reason why you should combine JS or CSS files...but there its HTTP)
Alternatives
- not maintained
- only for ZF2
- only compressed possible
- only output direct to a file
- no compression possible
- class hierarchy can be wrong (e.g. a class requires an interface and the interface comes later in the file...but in the meantime autoloader have loaded the interface -> "cannot redeclare error")
Benchmarks
http://stackoverflow.com/questions/8240726/are-there-performance-downsides-while-using-autoloading-classes-in-php https://mwop.net/blog/245-Autoloading-Benchmarks.html