I wrote (branched with APC and supports) APCu: the shared memory cache will not help you. Their internal storage area already has a certain structure, you cannot change it. You can store your structure as objects, but they and no other value are actually shared between PHP instances. Shared cached apc caches, copying from shared memory for each context that requests a value.
I wrote pthreads (PHP extension): threads will not help you. Just like APC, to copy from shared memory, threads must.
PHP doesn't share anything all the time, otherwise you are breaking material. You could write code that would seem to be memory sharing, but that would not be so; The rules must never be broken.
I donโt think that PHP is a reasonable target language, if the main requirement is efficiency, you seem to have realized this by the end of your first paragraph. I may be mistaken in this, but armed with all the above facts, I would be surprised if you do not agree.
Although this is not an intelligent language, it is perhaps an intelligent platform. I assume that you want to use this in the context of a web application, and therefore target PHP, but a much more reasonable task would be to implement structures and algorithms in a suitable language and expose them to your web application through the extension.
A suitable language usually means C or C ++ to extend PHP, but may mean others if you are inventive enough.
You still canโt break the rules, but you donโt need to.
Obviously, it depends on your ability to do these things.
source share