Re: Opcache::get($key), set($key, $value) to shared memory, is planned in PHP 7.1?

From: Date: Mon, 25 Apr 2016 18:13:15 +0000
Subject: Re: Opcache::get($key), set($key, $value) to shared memory, is planned in PHP 7.1?
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-92747@lists.php.net to get a copy of this message
On 25 April 2016 at 20:07, S.A.N <ua.san.alex@gmail.com> wrote: > 2016-04-25 20:56 GMT+03:00 Rowan Collins <rowan.collins@gmail.com>: > > S.A.N wrote on 25/04/2016 18:49: > >>> > >>> There's not really a huge connection between opcode caching and > >>> optimization > >>> >(OpCache) and shared memory data caches (APCu, memcached, etc), so I > >>> > don't > >>> >think there's any particular logic to calling such functions > "opcache". > >>> > > >>> >So I guess the question becomes: "should APCu be made part of core?" > I'm > >>> > not > >>> >aware of anyone having proposed that, so don't know if there are > strong > >>> >feelings for or against such a thing. > >> > >> Yes, there are a lot of libraries to work with shared memory, but why > >> should they if there OPcache in core PHP? > >> Functions get, set key values will be useful and in demand. > > > > > > Because different situations call for different functionality. If the > only > > reason not to use APCu was the need to install a PECL extension, then > nobody > > would have implemented a PECL extension for Memcache, or Redis, etc. > > > > Storing data in PHP's shared memory has several downsides - for instance, > > inability to share with CLI / services built in other languages, > > non-persistent across server restarts, not shareable across instances, > etc. > > For you, these may not be an issue, but to say that "if APCu > functionality > > was in core, nobody would need any other memory cache" is somewhat naive. > > I am not against third-party libraries, I want to have this > functionality out of the box, it seems to me correct to make these > functions in OPCache, instead of adding Apcu to PHP core, IMHO... > You are still asking for a tool that does a very precise and single thing to be re-purposed into a completely different scope. Use the right tool for the right job: including APCu would be much clearer/simpler than making OpCache an all-purpose shared memory space for userland. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

« previous php.internals (#92747) next »