performance - Symfony2: class to compile with OPcache -
in symfony2, in extension file of bundle, possible call:
$this->addclassestocompile([class1, ....])
this adds given files cached file classes.php => can improve performances if put here used classes, because php process have find , process 1 file insteaf many.
but 5.6 version of php, there opcache can cache files , precompile them. guess symfony part isn't necessary anymore?
by using byte code cache php cache classes separately bootstrapped cache file. apc used years achieve this. php5.5 included opcache default handle opcache. apc enabled users add cache items itself, opcache not available users.
because of that, apcu split original apc library traditional user caching becomes available > php5.4. more info symfony performance can found in the book's performance chapter.
to answer question symfony bootstrap: if use both bootstrap caching , bytecode cache, adding files bootstrap result bigger bytecode cache file. if application has classes (like kernel.request
listeners) used in every request, adding them bootstrap makes sense. otherwise add overhead to, , marginally slow down other requests.
Comments
Post a Comment