[RFC] [VOTE] Preloading

php.internals

Dmitry Stogov

7 years ago
Hi internals, The preloading RFC is turned into voting state. https://wiki.php.net/rfc/preload Many thanks to Anatol, MZPERX and Xinchen for testing. I hope, most of the implementation issues should be fixed now. Thanks. Dmitry.

Dan Ackroyd

7 years ago
Hi Dmitry, On Tue, 6 Nov 2018 at 10:05, Dmitry Stogov <dmitry@zend.com> wrote:
> > Hi internals, > > > The preloading RFC is turned into voting state.
Apologies if it's been asked before but from:
> Only classes without unresolved parent, interfaces, traits and constant > values may be preloaded. If a class doesn't satisfy to this condition, ...
Is it possible to inspect which classes have been successfully preloaded, and/or which classes have failed to be preloaded due to violation of the appropriate conditions? cheers Dan

Christoph Becker

7 years ago
On 06.11.2018 at 12:00, Dan Ackroyd wrote:
> On Tue, 6 Nov 2018 at 10:05, Dmitry Stogov <dmitry@zend.com> wrote: > >> The preloading RFC is turned into voting state. > > Apologies if it's been asked before but from: > >> Only classes without unresolved parent, interfaces, traits and constant >> values may be preloaded. If a class doesn't satisfy to this condition, ... > > Is it possible to inspect which classes have been successfully > preloaded, and/or which classes have failed to be preloaded due to > violation of the appropriate conditions?
The RFC states: | opcache_get_status is extended to provide information about preloaded | functions, classes and scripts under the “preload_statistics” index.
-- Christoph M. Becker

Dmitry Stogov

7 years ago
On 11/6/18 2:35 PM, Christoph M. Becker wrote:
> On 06.11.2018 at 12:00, Dan Ackroyd wrote: > >> On Tue, 6 Nov 2018 at 10:05, Dmitry Stogov <dmitry@zend.com> wrote: >> >>> The preloading RFC is turned into voting state. >> Apologies if it's been asked before but from: >> >>> Only classes without unresolved parent, interfaces, traits and constant >>> values may be preloaded. If a class doesn't satisfy to this condition, ... >> Is it possible to inspect which classes have been successfully >> preloaded, and/or which classes have failed to be preloaded due to >> violation of the appropriate conditions? > The RFC states: > > | opcache_get_status is extended to provide information about preloaded > | functions, classes and scripts under the “preload_statistics” index.
Right, if I remember properly, this was Rasmus idea. $ sapi/cli/php -r 'var_dump(opcache_get_status());' array(9) {   ...   ["preload_statistics"]=>   array(4) {     ["memory_consumption"]=>     int(912672)     ["functions"]=>     array(?) {       [0]=>       string(8) "_preload"       ...     }     ["classes"]=>     array(?) {       [0]=>       string(38) "Zend_Controller_Action_Helper_Abstract"       ...     }     array(?) {       [0]=>       string(46) "/home/dmitry/php/etc/preload.php"       ...     }   }   ... } Thanks. Dmitry.

Levi Morrison

7 years ago
On Tue, Nov 6, 2018 at 3:05 AM Dmitry Stogov <dmitry@zend.com> wrote:
> > Hi internals, > > > The preloading RFC is turned into voting state. > > > https://wiki.php.net/rfc/preload > > > Many thanks to Anatol, MZPERX and Xinchen for testing. > > I hope, most of the implementation issues should be fixed now. > > > Thanks. Dmitry. >
I am cautiously optimistic about this RFC. I hope some of the Future Scope items can be implemented soon.

Guilherme Blanco

7 years ago
Hi, Besides the yet-another naming convention, I'm quite optimistic about this RFC. Now on the convention, is there any reason why single underscore (_) is used instead of double underscores (__)? We already have __autoload, __sleep, __toString, __wakeup, etc. Regards, On Tue, Nov 6, 2018 at 11:08 AM Levi Morrison <levim@php.net> wrote:
> On Tue, Nov 6, 2018 at 3:05 AM Dmitry Stogov <dmitry@zend.com> wrote: > > > > Hi internals, > > > > > > The preloading RFC is turned into voting state. > > > > > > https://wiki.php.net/rfc/preload > > > > > > Many thanks to Anatol, MZPERX and Xinchen for testing. > > > > I hope, most of the implementation issues should be fixed now. > > > > > > Thanks. Dmitry. > > > > I am cautiously optimistic about this RFC. I hope some of the Future > Scope items can be implemented soon. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- Guilherme Blanco Chief Architect at Statflo Inc.

Benjamin Morel

7 years ago
> > Now on the convention, is there any reason why single underscore (_) is > used instead of double underscores (__)?
Are you talking about _preload()? I guess this is just an example userland code in the RFC, not a new internal or magic method.

Christoph Becker

7 years ago
On 07.11.2018 at 16:14, guilhermeblanco@gmail.com wrote:
> Now on the convention, is there any reason why single underscore (_) is > used instead of double underscores (__)? We already have __autoload, > __sleep, __toString, __wakeup, etc.
There is no convention at all. The ini directive opcache.preload allows to specify a PHP script which will be evaluated. Period.
-- Christoph M. Becker