Testing can be so interesting...
I ran your test, and got similar results to you on the "AbCdEfGhIj" string.
Ran the test again, using either quoted numbers or the words "no" or "yes"
for the string. The 'IS' was faster (CF is evaluating the word "NO" or "YES"
as boolean values).
Emilio did remember correctly, 'compareNoCase' is faster than 'is' when
comparing strings.
Thanks for the follow-up testing!
:-)
-----Original Message-----
From: Michael 'Maxx' Porter [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 25, 2000 2:05 PM
To: Fusebox
Subject: RE: Form Help
I did a the same test but user "AbCdEfGhIj" replace of "1"
2073 milliseconds
<cfloop index="x" from="1" to="10000">
<cfif x is "AbCdEfGhIj">
</cfif>
</cfloop>
841 milliseconds
<cfloop index="x" from="1" to="10000">
<cfif comparenocase(x,"AbCdEfGhIj")>
</cfif>
</cfloop>
server is a P-III 500 256 MB ram CF 4.5.1 WinNT 4 SP 6a
At 01:33 PM 11/25/00 -0700, you wrote:
>Interesting thought about compareNoCase....
>To find out, I just tried a 10,000-iteration cfloop test of 'is' v/s
>'comparenocase'.
><cfif comparenocase(x,"1")> took 1800ms for 10,000 iterations.
><cfif x is "1"> took 1600ms for 10,000 iterations.
>:-)
>
>-----Original Message-----
>From: Emilio [mailto:[EMAIL PROTECTED]]
>Sent: Saturday, November 25, 2000 12:32 PM
>To: Fusebox
>Subject: Re: Form Help
>
>
> > How about just <cfif Attributes.Json IS "on"></cfif> (the "IS" test
isn't
>a
> > case-sensitive test).
> > :-)
>
>I read a while back that compareNoCase is a faster way of comparing strings
>than using IS...
>
>Cheers,
>Emilio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists