0

I'm building an web application in php, I've create my own MVC framework(for multiple reason, like more flexibility).

I have a caller method that call the right Method in the right controller automatically with posted data. But I was wondering about the execution time of ReflectionMethod to get the params with default value of the wanted method and call it with call_user_func_array.

Is it okay to use ReflectionMethod one time on each server side call or would be better to build an array with all controller/method with default parameter (Oblige me to call an ApplicationComplied each time I add or change a method signature) ?

1 Answer 1

1

Reflection is still significantly slower than direct calls. Two things have changed:

Runtimes have optimized reflection mechanisms so that the difference has become smaller CPUs have gotten faster so that small inefficiencies are easier to tolerate Together, these two factors have brought the cost of reflection down to the point where you can routinely use it.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.