[thelist] CF: Tip - Usage of Boolean Values

Frank lists at frankmarion.com
Wed Jul 16 13:33:11 CDT 2003


At 12:51 AM 2003-07-16 -0700, you wrote:
>Was reading Frank's tip and thought it would be worth conducting an 
>experiment. The following code proves what Frank suggested, and introduces 
>something Frank didn't mention, which is checking to see if a Boolean 
>value is false (method 3 in my experiment). Also, I'm using cfscript, but 
>it should all end up being the same in the end. On average, method 1 and 3 
>run the fastest, about 31ms on my local machine, while methods 2 and 4 
>take on average about twice as long.


Oddly enough for running 4.5sp2 on a PC, I find that methods 1 and 4 are 
consistently fastest, but by a margin of of perhaps 30 ms or so. In order 
for it to run, I've had to add x=1; to each.

Three iterations

method 1: 480
method 2: 501
method 3: 511
method 4: 461

method 1: 471
method 2: 561
method 3: 581
method 4: 470

method 1: 481
method 2: 500
method 3: 511
method 4: 471

Yet, when placed in a loop (looped over the whole thing ten times, the 
values came out identical across each loop. I don't get it, or know how to 
interpret the results. Does this mean that the difference is -in the long 
run- insignificant? (Code I used at http://www.frankmarion.com. It's under 
Goofin' around.)

Here is the average result over 10 iterations of Michael's code.

Averages
520.7
562.8
573.8
529.8





--
Frank Marion     lists at frankmarion.com      Keep the signal high.  



More information about the thelist mailing list