I was noticing a small app slowing down for no real reason on AB tests...
I was loading a list of information like so:
// Retrieve Cache list of Modules and Namespaces
$modules = $di->getCache()->get("modules");
$namespaces = $di->getCache()->get("namespaces");
$events = $di->getCache()->get("events");
This was giving me about 500 Requests Per Second on average......
Grabbing the DI once
$memcached = $di->getCache();
// Retrieve Cache list of Modules and Namespaces
$modules = $memcached->get("modules");
$namespaces = $memcached->get("namespaces");
$events = $memcached->get("events");
This Bumped it up to 700 Requests Per Second...
Don't get carried away on accessing the DI directly, load it once if you can