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

From: Date: Sun, 25 Nov 2018 21:43:15 +0000
Subject: Re: [mini-RFC] Disable opcache per script using "declare(cache=0)"
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-103498@lists.php.net to get a copy of this message
Is that space rrrrrrreeeeeally 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" <vsuraski@gmail.com> wrote: On Sun, Nov 25, 2018 at 7:03 AM Marco Pivetta <ocramius@gmail.com> 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 will (in all likelihood) never be accessed again anyway. Invalidating a file only ensures it won't be fetched again from the opcache - it doesn't actually free up the space it consumes. Invalidate it or not, in both cases the outcome is the same - a bit of memory consumed by a file that will never again be fetched from the opcache. I believe this is what Dmitry's proposal was about - not putting the file into the opcache to begin with, to save the bit of memory that it would otherwise consume (but I could be wrong, as the savings are likely to be so small I'm not sure why we would care about them...). Zeev

« previous php.internals (#103498) next »