[ic] Strange behavior when using CGI values as loop list elements

Mike Heins mike at perusion.com
Wed Feb 25 21:36:58 UTC 2009


Quoting Marty Tennison (marty at dripdepot.com):
> Perl 5.8.8 and 5.10.0 (both threaded and non-threaded tested)
> IC 5.6.1
> Apache 2.x using mod_perl2 (not tested with vlink or tlink)
> Mysql 5.0.67
> ====================================
> Hi All,
> 
> I've been banging my head on this one for a few days. 
> 
> When I use CGI values as elements in a loop list, I'm seeing an extreme
> slowdown. (orders of magnitude)  I've tried this on the demo site but
> unfortunately the benchmark tag is not available on the demo site.  So
> I'm not sure if this is reproducible on the demo or not.  I apologize if
> it is not but I'm wondering if what I am seeing is specific to my setup
> or not.  If anyone would like to test this, here is are the  steps.
> 
> 1) Create a test page (see contents below)
> 2) Call the test page like this....   
> http://www.domain.com/test.html?looplist=1
> 3) Check out the benchmark times (you'll need the benchmark tag for this)

It's an illusion. These times are so small that you can't count on them.
Try this:

	http://yourserver.com/test?looplist=1&numloops=100

[tmp looplist]1[/tmp]
<p>Loop using scratch variable=[scratch looplist]
[benchmark start=1]
[loop list="1..100" ranges=1]
[loop list="[scratch looplist]"]
    [loop-code]
[/loop]
[/loop]
Elapsed time: [benchmark]</p>

<hr>

[value name=looplist set="1" hide=1]
<p>Loop using value variable=[value looplist]
[benchmark start=1]
[loop list="1..100" ranges=1]
[loop list="[value looplist]"]
    [loop-code]
[/loop]
[/loop]
Elapsed time: [benchmark]</p>


<hr>

<p>Loop using cgi variable=[cgi looplist]
[benchmark start=1]
[loop list="1..100" ranges=1]
[loop list="[cgi looplist]"]
    [loop-code]
[/loop]
[/loop]
Elapsed time: [benchmark]</p>

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.328.4479  tollfree 800-949-1889 <mike at perusion.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer



More information about the interchange-users mailing list