It seemss that no one else has the problem I am having with large
strings.

If the patch is not going to be considered, may I at least ask for
suggestions from the list members for alternate solutions (of course
other than telling me to alter my design)?

Thanks,
/prakash


On Wed, Sep 26, 2001 at 03:52:13PM -0400, Prakash Kailasa wrote:
> We use HTML::Template extensively and we are very happy with it (thank
> you Sam, for a great module).
> 
> We have a couple of modules which create large reports (a several MB
> in size). These reports are created by putting together several
> smaller strings (each of which generated by other templates) in a
> container template. Basically, there is lot of string copying going
> on.
> 
> I examined the "print_to" option as an alternative to passing strings
> around, but it was not always appropriate in our case.
> 
> I thought it would be faster to pass references to strings to
> HTML::Template->param() instead of the strings themselves. Also, if I
> could coax HTML::Template->output() to return a string ref instead of
> the string itself, it could be even faster.
> 
> I have changed the output method in a couple of places to accomplish
> this. My preliminary (and very unscientific) tests show that on a string
> of 10 MB size, passing a reference is approximately 37% faster. Passing
> a reference and accepting a reference in return value is approximately
> 47% faster.
> 
> Of course, for smaller strings the speedup is negligible (on a 10K
> string, the speedups are 7% and 6% respectively).
> 
> I hope the overhead added by the extra checks is negligible.
> 
> FWIW, I am attaching the patch and my test results.
> 
> Sam, if you think it is reasonable, could you apply this patch to
> HTML::Template?
> 
> Thanks,
> /prakash

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to