If you return a response object from your controller, then the rest of the
MVC dispatch is simply skipped.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 25 September 2013 19:46, Philip G <[email protected]> wrote:

> I'm wondering if there's anything I can do to speed up some numbers when
> using ZF2 MVC REST interface. Here are the stats:
>
> Loading Module Linux: 0.073524951934814
> route: 0.19534397125244
> dispatch: 0.21075201034546
> Core\Controller\ErrorCodesController::get start: 0.22418999671936
> Core\Controller\ErrorCodesController::get finish: 0.23645901679993
> render: 0.32171893119812
> finish: 0.32578086853027
> Application run time ("error_codes"): 0.328941822052
>
> Loading Module Linux is the last module in the module list. "route" call is
> an attached event:
>         $eventManager->attach('*',
>                 function ( $e ) use ($logger) {
>                     $logger->runtime($e->getName());
>                 }, 9999);
>
> Now, from what you can see, there's some obvious huge shifts between spots
> in the code. Specifically from the last module to first route trigger. From
> there, everything it instant until the jump to the render event, which I
> actually skip:
>     public function skipRenderer(MvcEvent $e)
>     {
>         $e->stopPropagation();
>     }
>
> What I'm trying to do now is figure out a way to speed up these two rather
> large jumps in times (over 100ms in both instances).
>
> Is there something I can do to handle the post-dispatch after the
> controller finish to speed things up?
>
> This is a big concern of ours for one set of APIs that are used for syncing
> files -- we're looking at thousands of calls. And this extra 200ms adds up
> to several seconds, and minutes, rather quickly.
>
> ---
> Philip
> [email protected]
> http://www.gpcentre.net/
>

Reply via email to