[cgiapp] use persisten instance of cgiapp with cgi::fast?

Michael Peters mpeters at plusthree.com
Mon Jul 19 09:42:39 EDT 2010


On 07/19/2010 07:16 AM, Dietrich Streifert wrote:

> As the method implies a new instance of my cgiapp is created for every
> request. With speedy_cgi I used to only create a cgiapp instance once
> and reuse it on request. I consider my cgiapp to be a big one and it
> would benefit a lot from being instantiated once and  the instance
> reused often.

Are you sure? Have you benchmarked it? It doesn't matter how much code 
is in your application or how many modules you are pulling in since 
that's a one time compilation hit at startup.

The only thing I can think of one reason to not want to call new() on 
every request and that is if you are doing something intensive at init 
or setup time.

-- 
Michael Peters
Plus Three, LP


More information about the cgiapp mailing list