[Buffalo-pm] apache::storage

joshj@linuxmail.org joshj at linuxmail.org
Wed Feb 8 08:18:15 PST 2006


Thanks Dan and Kevin.

I am actually working in mod_perl. I'm making my own custom handler (I
know that there are 1001 of them on CPAN. This is purely for my learning
experience). I just want to see how fast I can make it to do my specific
tasks on my P2.

One of my original problems was that I was dynamically
loading subroutines. But the overhead of that was killing me. Then I
found that mod_perl kept the subroutine stored in memory. So just adding
an 'if (!defined(&$sub_ref))' before loading it made a dramatic
performance increase.

Now there is still the File IO of opening up each page and pages
included within (like common HTML header files and footer files). I'm
looking for a way to store them in memory. Then I'd check and only open
them if it couldn't find them in memory. Maybe there is another way to
accomplish this? Could that $main::page_1="the content" trick work? Or
better yet, could I make that a hashref: $main::pages->{page_1} = "the
content"? Would A hashref be faster? My understanding of them is that
they access the memory location like pointers in C do. Is that right?

As it stands it beats the pants off of what mod_php and servlets can do
on this same machine. Keep in mind though that I haven't really tried to optimize
those ones yet. And this isn't scaled up to their level either. I'm just
impressed with power and control that mod_perl has.

-Josh J

Thus spake Kevin Eye on Wed, 8 Feb 2006

> I'm not all that clear on the nnecessity of Apache::Storage. In mod_perl, if
> you just shove something into a global variable ($main::save_for_later =
> $something_important), won't it be around for the next request? Or does it
> disallow that or somehow clean up after itself?
>
> - Kevin
>
>
> On 2/8/06 9:17 AM, "DANIEL MAGNUSZEWSKI" <dmagnuszewski at mandtbank.com>
> wrote:
>
>> Have you looked into mod_perl?
>>
>> http://www.perl.com/pub/a/2002/02/26/whatismodperl.html
>> http://www.perl.com/pub/a/2002/03/22/modperl.html
>>
>> Jim or Kevin can probably shed more light on this.
>>
>> -Dan
>>
>>>>> <joshj at linuxmail.org> 02/07/06 9:36 AM >>>
>> Is there an Apache2 equivelent of Apache::Storage which will let me
>> keep
>> things in apache's memory to use later? Like frequently accessed
>> functions and such.
>>
>> -Josh J
>> _______________________________________________
>> Buffalo-pm mailing list
>> Buffalo-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/buffalo-pm
>>
>>
>> _______________________________________________
>> Buffalo-pm mailing list
>> Buffalo-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/buffalo-pm
>
> -- 
> Kevin Eye
> Web Applications Developer
> Marketing and Creative Services
> University at Buffalo
> 330 Crofts Hall
> Buffalo, NY 14260
> eye at buffalo.edu
> phone (716) 645-5000 x1435
> fax (716) 645-3765
>
>
>


More information about the Buffalo-pm mailing list