<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>> And here is the crux of the mod-perl diversion...  the Tim Conners already<br>
</span>                                                                 ^ bah<br>
Why does everyone do that? :)<br></blockquote><div><br></div><div>Diverting conversation is a specialty that I attempt to excel at... and I think most others on this list do too.  :-P</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
> had existing code in the form of CGI::Fast.... So to get the code to run<br>
> faster, then a couple of lines of Apache config to setup mod_perl, would<br>
> solve the problem.<br>
<br>
</span>From my very brief reading, doesn't mod_perl have the same problem that<br>
CGI::Fast has in that the brief running program you expected to set up a<br>
bunch of global variables, which then get discarded upon program exit, are<br>
all now sitting inside the scope of another loop, and now you have to port<br>
your code to make sure that all such traces of global variables are<br>
reinitialised every loop?<br></blockquote><div><br></div><div><br></div><div>Depends on what you mean by global variables... </div><div><br></div><div><div>Often mod_perl will only speed up the initial perl-compilation bit -> the module initialisation is performed on every invocation.</div></div><div><div>ie: it means that any module-scope variables which you do modify at run-time, will be reset at every invocation.</div></div><div><br></div><div><div>... thus you code should just "drop in" with no changes [ and only say 3 lines of Apache config -> load mod-perl and configure Apache/ModPerl::PerlRun/Registry etc  ].</div></div><div><br></div><div>For a decent percentage (aka: most, some, a little bit...) of code, a global variable is initialised only on module startup, then used in read-only context (aka treating them as global constants).</div><div>So with a few more lines of Apache config, you can pre-load modules which have heavy module initialisation... this allows each invocation to inherit the pre-loaded data.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
So there's no silver bullet drop in replacement for<br>
CGI::really_really_slow.  You'll be porting code one way or another.<br></blockquote><div><br></div><div>No porting required.</div><div><br></div><div>It could be a silver bullet... but its sheen is sometimes a little off, such as requiring manual restart of Apache whenever a module-file (<a href="http://xx.pm">xx.pm</a>) is changed.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
(my 5 ajax queries now take a fraction of a second total instead of<br>
bogging the pi down for more than 5 seconds.  Hopefully all my globals<br>
are reset each CGI::Fast loop<br></blockquote><div></div></div><br></div><div class="gmail_extra">Does this mean you used mod-perl ?   Or some other technique?</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>