Closed halaei closed 5 years ago
I'm trying to learn how to compile php and benchmark to check this.
It is only about compiling code and thinks related to that. So it is not going to cache the logic of bootstrapped frameworks into some variable that may be used later:
Static members and static variables
To avoid misunderstanding, it is clear stated that preloading doesn't change the behavior of static class members and static variables. Their values are not going to relive request boundary.
So it means other solutions (microframeworks, swoole, ...) are still going to be beneficial.
As the RFC stated
While storing files in an opcode cache eliminates the compilation overhead – there is still cost associated with fetching a file from the cache and into a specific request's context. We still have to check if the source file was modified, copy certain parts of classes and functions from the shared memory cache to the process memory, etc.
so yes, it doesn't change any existing logic, which is good, because it means we don't have to change a log, and PHP without preloading support (old PHP version, or opcache disabled) won't be affected, but it still can help the performance. Why not have a try?
We will definitely do it.
@taylorotwell Any updates on this? Seems there is no "right" way to this. All solutions from various blogs/tutorial seems a bit hacky.
Any update on your approach to this @taylorotwell ?
Following this thread.
I am wondering if anyone has tried PHP 7.4 preloading (https://wiki.php.net/rfc/preload) with Laravel.