Replies: 8 comments
-
BTW I've done a little of my own benchmarking in certain cases with classes vs arrays https://stackoverflow.com/a/64157551/721019. I also have found that |
Beta Was this translation helpful? Give feedback.
-
Hi @n0nag0n I have the impression that the secret, which is not a secret, is based on obvious. Among this 20%, in a web application, we find the routing system that allows URL resolution. Ubiquity routingNothing but simple things :
This start-up phase does not need to be done at each request with async platforms (Swoole, Workerman, Roadrunner, ngx_php...). URL resolution:
|
Beta Was this translation helpful? Give feedback.
-
And while you're eating your popcorn on the sofa, let me pick up another important mechanism: the execution of an actionHere again, only simple things:
There is a snobbery effect in the world of PHP developers, and some people think that such a simple design is synonymous with bad practice or bad design. You don't need to be an engineer to use an MVC framework. |
Beta Was this translation helpful? Give feedback.
-
Nice diagrams :) So then would you mind explaining how you handle things like middleware (and injecting what you need for the middleware)? Also when you say the routing is parsed from cache, what do you do with dynamic routes ( |
Beta Was this translation helpful? Give feedback.
-
And how aggressive are you with your object creation and what is in the object? For instance you have the URequest object which will be used on every request. Do you pass that object around in Also a pattern I notice in looking through your code for instance is with your |
Beta Was this translation helpful? Give feedback.
-
Request
RoutingWhile waiting to complete the middleware part, I come back to your question about routing. [
['bar/(.*?)'=>route def],
['bar/foo/(.*?)'=>route def]
] I'm considering this: ['bar'=>[
'(.*?)' => route def,
'foo' => [
'(.*?)' => route def
]
]
] As you can see, there is still work to be done in terms of optimisation. MiddlewaresOn this subject, the answer is more complex... To be continued |
Beta Was this translation helpful? Give feedback.
-
Never used the discussion feature before....fancy :) |
Beta Was this translation helpful? Give feedback.
-
Hi @jcheron ,
So I know that ubiquity is ridiculously fast, but I wondered if you had a set of guiding principles that you use when you develop PHP code? I've seen this page, which seems to be geared more towards how people implement your framework, but I was wondering what you do when you develop your own framework? What lessons have you learned and what habits did you have to break in order to achieve the level of optimization that your framework enjoys? I also noticed your php benchmarks tool which is awesome!
From what I've gathered, it feels like a couple bullet points would at least be:
Anyway, TIA. I'm sure you have a wealth of knowledge to share and I (and the world in general) would love hearing what you have to say :)
Beta Was this translation helpful? Give feedback.
All reactions