Re: [PHP-DEV] declare(cache=0) - explanation (was: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)")

2018-11-26 Thread Nikita Popov
On Mon, Nov 26, 2018 at 10:15 AM Zeev Suraski wrote: > On Sun, Nov 25, 2018 at 11:43 PM Marco Pivetta wrote: > > > Is that space rrreally a problem? > > > > Take the example ZF loader from the RFC: that barely makes any difference > > at all. > > > > A stronger reasoning for another lang

Re: [PHP-DEV] declare(cache=0) - explanation (was: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)")

2018-11-26 Thread Rowan Collins
On Mon, 26 Nov 2018 at 09:15, Zeev Suraski wrote: > The goal of declare(cache=0) would be to avoid persisting utility > functions/classes that have to do with a particular preload.php > implementation - so that they don't become a part of the app's memory > context and 'pollute' its scope. > Th

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-26 Thread Zeev Suraski
On Sun, Nov 25, 2018 at 6:04 PM Sara Golemon wrote: > On Sat, Nov 24, 2018 at 11:03 PM Marco Pivetta wrote: > > > Adding to the pile of "it's an edge case", since the preload scripts will > > be procedural, wouldn't it be sufficient to call > > `opcache_invalidate(__FILE__)` at the end of them?

[PHP-DEV] declare(cache=0) - explanation (was: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)")

2018-11-26 Thread Zeev Suraski
On Sun, Nov 25, 2018 at 11:43 PM Marco Pivetta wrote: > Is that space rrreally a problem? > > Take the example ZF loader from the RFC: that barely makes any difference > at all. > > A stronger reasoning for another language construct (that changes engine > behaviour) is kinfa required. >

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Dmitry Stogov
vember 26, 2018 12:43:15 AM To: Zeev Suraski Cc: PHP Internals List Subject: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)" Is that space rrreally a problem? Take the example ZF loader from the RFC: that barely makes any difference at all. A stronger

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Marco Pivetta
Is that space rrreally a problem? Take the example ZF loader from the RFC: that barely makes any difference at all. A stronger reasoning for another language construct (that changes engine behaviour) is kinfa required. On 25 Nov 2018 22:34, "Zeev Suraski" wrote: On Sun, Nov 25, 2018

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Zeev Suraski
On Sun, Nov 25, 2018 at 7:03 AM Marco Pivetta wrote: > Adding to the pile of "it's an edge case", since the preload scripts will > be procedural, wouldn't it be sufficient to call > `opcache_invalidate(__FILE__)` at the end of them? > > That would actually not do anything useful - as the file wil

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Marco Pivetta
Even if there were definitions in said script, the same issue would arise with a directive. On Sun, 25 Nov 2018, 18:35 Larry Garfield On Saturday, November 24, 2018 11:03:01 PM CST Marco Pivetta wrote: > > Adding to the pile of "it's an edge case", since the preload scripts will > > be procedural

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Larry Garfield
On Saturday, November 24, 2018 11:03:01 PM CST Marco Pivetta wrote: > Adding to the pile of "it's an edge case", since the preload scripts will > be procedural, wouldn't it be sufficient to call > `opcache_invalidate(__FILE__)` at the end of them? Are we certain that it will always be procedural?

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-25 Thread Sara Golemon
On Sat, Nov 24, 2018 at 11:03 PM Marco Pivetta wrote: > Adding to the pile of "it's an edge case", since the preload scripts will > be procedural, wouldn't it be sufficient to call > `opcache_invalidate(__FILE__)` at the end of them? > I suppose the only negative there would be some very minor

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-24 Thread Marco Pivetta
Adding to the pile of "it's an edge case", since the preload scripts will be procedural, wouldn't it be sufficient to call `opcache_invalidate(__FILE__)` at the end of them? On Sat, 24 Nov 2018, 20:57 Stanislav Malyshev Hi! > > >> I'm not sure if you're missing anything fundamental - it's just t

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-24 Thread Stanislav Malyshev
Hi! >> I'm not sure if you're missing anything fundamental - it's just that >> the preload.php file Dmitry's referring to (the one that's responsible >> to loading all the other files) - is one file that's pretty much by >> definition, will be of no use at any later point in the lifetime of >> the

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-24 Thread Rowan Collins
On 23/11/2018 23:49, Zeev Suraski wrote: I'm not sure if you're missing anything fundamental - it's just that the preload.php file Dmitry's referring to (the one that's responsible to loading all the other files) - is one file that's pretty much by definition, will be of no use at any later poi

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Stanislav Malyshev
Hi! > Especially, the main preload.php, usually should be marked, to disable its > caching. Why should it be marked as non-cacheable? I am feeling there's something important I am missing here. Could you explain a bit more about this? -- Stas Malyshev smalys...@gmail.com -- PHP Internals - P

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Zeev Suraski
On Sat, Nov 24, 2018 at 1:18 AM Rowan Collins wrote: > On 23 November 2018 12:48:40 GMT+00:00, Dmitry Stogov > wrote: > >Especially, the main preload.php, usually should be marked, to disable > >its caching. > > Sorry, could you explain for those of us in the peanut gallery why this is > the cas

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Rowan Collins
On 23 November 2018 12:48:40 GMT+00:00, Dmitry Stogov wrote: >Especially, the main preload.php, usually should be marked, to disable >its caching. Sorry, could you explain for those of us in the peanut gallery why this is the case? I'm struggling to understand what it means to preload something

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Sara Golemon
On Fri, Nov 23, 2018 at 8:36 AM Pierre Joye wrote: > > Especially, the main preload.php, usually should be marked, to disable > its > > caching. > > > > should this specific case not be done automatically then? > > I'm with Pierre on this. During the preload phase, we should probably have implic

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Pierre Joye
___ > From: Nikita Popov > Sent: Friday, November 23, 2018 1:08:53 PM > To: Dmitry Stogov > Cc: PHP internals > Subject: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using > "declare(cache=0)" > > On Fri, Nov 23, 2018 at 11:04 AM Dmitry

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Dmitry Stogov
Hi Nikita, Especially, the main preload.php, usually should be marked, to disable its caching. Thanks. Dmitry. From: Nikita Popov Sent: Friday, November 23, 2018 1:08:53 PM To: Dmitry Stogov Cc: PHP internals Subject: Re: [PHP-DEV] [mini-RFC] Disable opcache

Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)"

2018-11-23 Thread Nikita Popov
On Fri, Nov 23, 2018 at 11:04 AM Dmitry Stogov wrote: > Hi internals, > > > I like to propose an ability to disable opcache caching per script, using > declare(cache=0) at start of PHP file. > > The idea was inspired by preloading usage, when some scripts are actually > preloading scenarios and h