perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Csongor Fagyal <conc...@conceptonline.hu>
Subject Re: Response->Include
Date Mon, 24 Feb 2003 11:10:02 GMT
>
>
>> Hi,
>>
>> If I understand correctly, <!--#include file="aspfile" 
>> args=@args-->compiles aspfile only once, and consequtive calls only 
>> pass @args to the precompiled script. I guess the same is done when I 
>> use $Response->Include($filename, @args). But what happens if I use
>
>
> Yes, it actually compiles to $Response->Include() on the backend.
>
>> $Response->Include(\$script_text, @args)? Is $srcipt_text recomplied 
>> every time I call it? If yes, can this behaviour be changed? Or, is 
>
>
> Yes, the script is recompiled each time.  The reason is that since
> the text is not being loaded from a static file, it is assumed to
> be dynamically generated.  If Apache::ASP were to cache compilations
> of dynamically generated code, this would be a large memory leak
> each time the script were to be called.
>
>> there a way - maybe that is rather a mod_perl question - to compile 
>> perl scripts (modulest, etc.) in runtime and keep them compiled in 
>> memory and shared between Apache childs?
>
>
> Sure, one way to cache dynamic code compilations that have no name
> would be to simply keep the subroutine reference that it is compiled
> to looked up by something like an MD5 checksum of the code itself. 

Yep, I was thinking about something like that.

> Something that could make things better would be a parse cache
> to cache the compilation of the ASP script to perl code, but still
> leave the perl code to perl eval of generated subroutine not cached.
> I have thought about adding a parse cache before, but I haven't
> heard of people needing this yet, perhaps because of using things
> like Apache::ASP->Loader() is good enough to cache compilations,
> or maybe Apache::ASP parsing is generally fast enough.

Actually I have my home-grown templating system, and I had this idea to 
take the templates and convert them to ASP, since my parser is very 
slow, while mod_perl scripts are not :-). One other way would be to 
generate ASP files and write them to disk, but I tend to dislike that idea.
Apache::ASP->Loader() is fine, but I do not like the idea of compiling 
scripts at server startup. My templates change too frequently for that.

Hmmm, I guess I need to find a more complex method... say, I 
"precompile" my templates and store them in $Application, while I point 
StateDir to the ramdisk. (As the matter of fact, I won't even need 
$Application if I use ramdisk...)

- Csongor


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message