Re: Are there performance overheads to RequestAction?

2006-06-30 Thread gwoo
as 100rk pointed out $this->params['bare'] == 1 when coming through requestAction. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com T

Re: Are there performance overheads to RequestAction?

2006-06-30 Thread Gonçalo Marrafa
On Fri, 30 Jun 2006 10:19:42 -0700 gwoo <[EMAIL PROTECTED]> wrote: > Yes if you put $this->render() in the method. As was discussed the > really should not be needed and a simple return is preferred. > > function foo(){ > return $this->Example->findAll(); > } OK, but doesn't work for me

Re: Are there performance overheads to RequestAction?

2006-06-30 Thread gwoo
Yes if you put $this->render() in the method. As was discussed the really should not be needed and a simple return is preferred. function foo(){ return $this->Example->findAll(); } --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Are there performance overheads to RequestAction?

2006-06-30 Thread [EMAIL PROTECTED]
I would really like to see my original question answered. Doesn't the view get rendered with requestAction(), even if the 'return' parameter isn't passed? Master bakers, can you enlighten us? Thanks in advance. --~--~-~--~~~---~--~~ You received this message beca

Re: Are there performance overheads to RequestAction?

2006-06-30 Thread Olivier Percebois-Garve
I'm also dreaming of a $this->isCalledByRequestAction I made a ticket for this https://trac.cakephp.org/ticket/1013 olivvv Gonçalo Marrafa wrote: > Hi. > > This thread is being very enlightening. I have a question though: doesn't > an action always render a view (unless $autoRender is set to

Re: Are there performance overheads to RequestAction?

2006-06-30 Thread 100rk
> if ($this->isCalledByRequestAction) { if (!empty($this->params['bare'])) But be careful, 'bare' parameter is 1 in case of ajax call also --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To

Re: Are there performance overheads to RequestAction?

2006-06-30 Thread Gonçalo Marrafa
Hi. This thread is being very enlightening. I have a question though: doesn't an action always render a view (unless $autoRender is set to false)? Here's an example: in one_controller.php: function foo() { $this->set('foo', $this->Foo->findAll()); $this->render('foo_view'); } *NOT

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread gwoo
unless you want the Menu model available in all of your controllers, I would not put it in the uses array. Both the uses array and the method I described use references, so they are pretty much the same in that respect. As far as MVC, requestAction in a view should be avoided. Elements br

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread Felix Geisendörfer
One thing about your change to my code example gwoo: Maybe I'm missing something, but here is what I think. -> Your solution does better for the requestAction without view scenario However, what I was talking about, was to *remove* a requestAction call for the menu and move it to the AppContr

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread Olivier Percebois-Garve
very useful explanations felix and gwoo. Thanks a lot, I'll sleep less stupid tonight. gwoo wrote: > There are a couple of things to keep in mind in this discussion. > First, if you use full page caching putting a requestAction in and > element that called a menu controller would be better.

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread gwoo
There are a couple of things to keep in mind in this discussion. First, if you use full page caching putting a requestAction in and element that called a menu controller would be better. You can always use dont cache this Also, as of version 1.2 you will be able to specifically cache cert

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread Felix Geisendörfer
Hi olivvv: I just modified the AppController from a project I work on right now to only show the process of setting $menu in every view (unless you set your controllers var $useMenu to false), so you can use it in your layout without having to do requestActions: class AppController extends C

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread Olivier Percebois-Garve
Hi felix " My advice to people who are concerned about performance, is to think about what they are using requestAction for right now, and to try to figure out if some of it should be moved to the AppController. This will always be the better and faster solution if you have something like a me

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread admataz
Ok, between this, the wiki and manual things are getting tasty and I think I'm understanding how to bake better cake... thanks all for the discussion and feedback. Previously I was using requestAction to return rendered views from foreign controllers, by using it in my elements or directly in th

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread Felix Geisendörfer
Hi johnwik, I think the problem with requestAction is not the dispatching alone. There is a good bit of things happening, just to name a view: Dispatcher Dispatcher does routing Dispatcher figures out what (Plugin)/Controller/Action is request Dispatcher loops through all $paths->con

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread 100rk
It depends on way how You're using requestAction(). If You're using it like: $this->requestAction('/some/url'); or $somedata = $this->requestAction('/some/url'); then it is supposed to be quite fast, as target controller's action is not rendered. Off course there is new dispatch process for every

Re: Are there performance overheads to RequestAction?

2006-06-29 Thread johnwik
Hi! I am also using actionRequest to render several different controllers from within a main controller and I have noticed that the dispatcher is called for each call to a controller. I haven't done any real testing yet so I'm not sure about the performance. Is there a way to reuse the Dispatcher

Re: Are there performance overheads to RequestAction?

2006-06-28 Thread admataz
Thanks Felix, That's great info - I actually had bookmarked your blog post in my feeds to read later - wasn't sinking in when I tried reading it before - so I'll take a closer look now. all the best, -ad --~--~-~--~~~---~--~~ You received this message becau

Re: Are there performance overheads to RequestAction?

2006-06-28 Thread Felix Geisendörfer
Hey admataz, from my experience the performance overhead from requestAction can be significant when you have more then 5-7 of such calls for each action you execute. However, this definitely depends on the work-load that is caused by the actions/views themselfs, so I would need to do a serie