On Tue, Aug 17, 2010 at 6:23 AM, Tomas Doran <[email protected]> wrote:

>
> On 17 Aug 2010, at 06:27, Octavian Rasnita wrote:
>
>> I load and store this object in the stash on each request in the
>> Root::auto : Private method with:
>>
>> $c->stash(menu => $c->model('Menu'));
>>
>> But this would re-create the menu object on each request, and this takes
>> time.
>>
>
> No, it wouldn't. The adaptor you showed has a lifetime of the application,
> and so it won't be recreated each request.
>

</lurk>
Hmm, this is interesting. Are you referring to the "Moose goodness" of

has "menu_data" => (
   is => "ro",
   isa => "HashRef",
   default => sub { shift->config->{menu_data} }, #pull data from config
);

Is that the part you're referring to as application-lifetime?


Also, even if you were creating an object every request (which you aren't),
> if you're worrying about this without numbers, then this is premature
> opimisation.
>
> Cheers
> t0m
>
>
>
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>



-- 
will trillich
"I just try to make sure that the laziest thing I can do at any moment is
what I should be doing." -- matt.might.net
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to