Did you actually profile that with a debugger? What is eating up that much?
(what MVC event specifically)

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 25 September 2013 20:11, Philip G <[email protected]> wrote:

> At the end of my controller method, I added (and a logger):
>         $this->logger->info(__METHOD__ . ' returning: ' .
> get_class($this->getResponse()));
>         return $this->getResponse();
>
> While it did then skip the render event, it didn't have any affect on the
> timing:
>
>  Core\Controller\ErrorCodesController::get finish: 0.23970007896423
> Core\Controller\ErrorCodesController::get returning:
> Zend\Http\PhpEnvironment\Response
> finish: 0.32675385475159
>  Application run time ("error_codes"): 0.32999801635742
>
> Any other suggestions?
>
> Changed the ending to:
>
> $this->getEvent()->stopPropagation();
>
>
> And that didn't affect anything either:
>
> Core\Controller\ErrorCodesController::get finish: 0.23691821098328
>  render: 0.3210141658783
> finish: 0.32515716552734
>
>
>
>
> ---
> Philip
> [email protected]
> http://www.gpcentre.net/
>
>
> On Wed, Sep 25, 2013 at 10:50 AM, Marco Pivetta <[email protected]>wrote:
>
>> 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