On 25/06/2018 21:42, Larry Garfield wrote:
What will definitely bring benefit to real world workloads is preloading,
which (if we manage to do it) will dramatically reduce the per-request
initialization stage. It could bring us much of the benefit of async-IO
long running processes without sacrificing the isolation advantages of the
traditional PHP execution model. It will likely also play nicely with
JIT. But this is floors upon floors of speculation - we'll have to see...
This is more what I'm talking about. A way to get a process up to "all my
service objects are created, my code is parsed, my events are registered,
etc.", and then save that state and do the usual shared-nothing after that
without having to repeat that part. I agree that's likely several layers up
from where we're talking, but if it's a potential thing that could be done
then that's a good argument for doing this thing now.
I keep coming back recently to the idea of native support for "packages"
or "modules":
- a bunch of classes edited as separate files, but loaded "in one hit",
rather than autoloaded one class at a time
- a more "solid" namespace, e.g. visible in Reflection
- configuration of declare()-style directives that apply to the whole module
- "module private" visibility for classes (and maybe, later, methods,
although the phrase "private protected" [1] makes my head hurt)
I think this would fit naturally with preloading, and making OpCache
(and JIT) more central to the engine, and fits more naturally with where
things like Composer and PHP-FIG have taken the language.
It might even link to FFI - maybe a module linking to C functions in a
certain way could act as a light-weight, dynamically-loadable, extension.
I realise I'm dreaming now, and don't expect this to all suddenly appear
in 8.0, but I wonder if it's worth exploring as a framework to build
around / toward?
[1]:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php