Hello,

JF>Measurable, but also negligable (code below):
JF>
JF>Benchmark: timing 50000 iterations of ref, val...
JF>  ref:  3 wallclock secs ( 2.72 usr +  0.12 sys =  2.84 CPU) @ 17605.63/s (n=50000)
JF>  val:  7 wallclock secs ( 6.05 usr +  0.18 sys =  6.23 CPU) @  8025.68/s (n=50000)

So, we use the magic dereference trick in a lot of our code at Tellme,
because it seemed like a good idea not in terms of time performance, but
in saving memory. We have a lot of XML data that we output that can't
always be output a bit at a time... so we end up having big XML strings
that we pass around different handlers. It seems like a good memory
savings to be able to $r->print a reference directly.

I haven't peeked under the hood to see if $r->print just dereferences any
scalar references it gets anyway... in which case the memory savings were
a red herring.

But anyway, just thought I'd comment that the reason I think most mod_perl
developers would think to use that functionality would be memory, rather
than speed. Pretty much all of our mod_perl servers are memory bound
rather than CPU bound, and are "fast enough" without much optimization.

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       [EMAIL PROTECTED]
Engineer                    1-800-555-TELL          Voice 650-930-9062
Tellme Networks, Inc.                                 Fax 650-930-9101
----------------------------------------------------------------------


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to