centos7 + docker(alpine3.7)php
composer 使用生產環境命令進行安裝laravel
composer install --no-dev --optimize-autoloader --prefer-dist
框架 | 執行時間 | 內存 |
---|---|---|
lumen | 8ms | 0.4MB |
lumen + Facades | 8.5ms | 0.5MB |
lumen + Facades + Eloquent | 13ms~14ms | 0.8MB |
laravel | 50ms~60ms | 1.6MB |
總體docker
public/index.phpbootstrap
bootstrap/app.phpcentos
改成php加載
withEloquent: 5.144ms 如何動態加載?
php7
loadComponent database: 4.931msapp
DatabaseServiceProvidercomposer
PaginationServiceProvider框架
可優化
Application::run: 3.758mside
dispatch: 3.479ms
parseIncomingRequest: 2.643ms
Request::capture: 2.007ms
Request::createFromGlobals: 0.984ms
Request::createRequestFromFactory: 0.947ms
Request::createFromBase: 1.005ms
爲何須要複製一份?
總體
public/index.php
bootstrap/app.php
Application::__construct: 1.471ms
kernel::handle: 43.308ms
Kernel::sendRequestThroughRouter: 43.117ms
bootstrap: 28.188ms
Application::bootstrapWith: 28.175ms
LoadEnvironmentVariables::bootstrap: 4.372ms
加載全部config文件,差別
RegisterProviders::bootstrap: 5.657ms Provider register 差別
ProviderRepository::load: 4.250ms
BootProviders::bootstrap: 8.048ms Provider boot 差別
Pipeline::then: 14.690ms
Router::dispatch: 12.202ms
runRoute: 10.434ms
runRouteWithinStack: 9.084ms Middleware 差別
prepareResponse: 2.220ms
Kernel::terminate: 4.068ms
Kernel::terminateMiddleware: 4.056ms