> This does not involve processes or forking. Even if every use of ->query
> caused CGI.pm to be loaded, compiled and new object returned (and none of
> that happens) it would still all be in the same perl process.

I believe (and we may just be semantically splitting hairs) that we're both
correct albeit on slightly differing points.

Multiple uses of 'require CGI' would not require more processor cycles than
a single use of 'require CGI', however multiple uses of '$cgi = new CGI;'
would.

Since a new object is being created each time the overhead required would be
defined by the operations that CGI.pm must perform in it's new() method.

CGI::Application does not return a new cgi object upon each call to query(),
it instead creates the object only once and stores it in
$self->{__QUERY_OBJ}. Any new calls to query will return the object stored
in $self->{__QUERY_OBJ} to save the time required to load a new object from
scratch.

I would like to see the code that Bob used for each of the tests, to perhaps
shed some light on the differences he listed as 'loading module' & 'new
process creation'.

Either way, due to the way that Jesse wrote CGI::App and it's caching
nature, the benefits of CGI::Simple over CGI may very well be in the data
extraction and not at all in the loading time of either module. Though
either gain would be negligible since never will a cgi object be loaded (or
new instances of it created - except via negligent coding) 100 times in the
execution of an application, and rarely will more than 20 (at least in my
experience) fields be read from a cgi object in a particular instance.


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to