Answer the question
In order to leave comments, you need to log in
How to optimize the code, what is the best way to do it?
there is this piece of code
foreach ($configuration as $module => $moduleSettings) {
if (!class_exists($module, false)) {
self::setUnit($module, new $module($moduleSettings));
}
timeRun($t++);
}
Answer the question
In order to leave comments, you need to log in
Don't do new $module :)
There is nothing to optimize in this snippet. Look at the constructors of all $modules, they need to be optimized. Also take a look at setUnit...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question