Re: Speed loss with parameters global_vars and loop_context_vars
Alex Kapranoff <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.html-template |
|---|---|
| Organization | Inner Mongolia |
| Message-ID | <[email protected]> |
* [email protected] <[email protected]> [December 14 2005, 15:00]: > I coded a site with an outer loop, an inner loop and an inner inner loop. global_vars and loop_context_vars were on. > > I was wondering about the time the output of this site lasts: 14 seconds ! After this I turned gobal_vars and loop_context_vars off and was wondering again: the output was processed after 1.5 seconds. > > I wrote a simplified Example (see below) and got the following results on my system: > global_vars=1, loop_context_vars=1: 2.4 seconds > global_vars=1, loop_context_vars=0: 5.7 seconds > global_vars=0, loop_context_vars=1: 5.7 seconds > global_vars=1, loop_context_vars=1: 13.0 seconds !!! > > So here is my question: Is this behavior normal ? Yes. HTML::Template global_vars are very inefficient. -- Alex Kapranoff, $n=["1another7Perl213Just3hacker49"=~/\d|\D*/g]; $$n[0]={grep/\d/,@$n};print"@$n{1..4}\n" ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click