Here's a test script you can run to test it.  My results were that there was
no noticible difference, even with 100,000 iterations.  Sometimes replace
was faster, sometimes replaceNoCase was faster.

<cfset iterations = 100000 />
<cfset string = "my cat is feline and rather catalicious" />
<cfset start = getTickCount() />
<cfloop from="1" to="#iterations#" index="i">
  <cfset replace(string, "cat", "dog", "all") />
</cfloop>
<cfset stop = getTickCount() />
<cfoutput>#stop - start#ms  for #iterations# 'replace' calls<br
/></cfoutput>
<cfset string = "my cat is feline and rather catalicious" />
<cfset start = getTickCount() />
<cfloop from="1" to="#iterations#" index="i">
  <cfset replaceNoCase(string, "cat", "dog", "all") />
</cfloop>
<cfset stop = getTickCount() />
<cfoutput>#stop - start# ms for #iterations# 'replaceNoCase' calls<br
/></cfoutput>

> -----Original Message-----
> From: Jim McAtee [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 23, 2004 10:07 AM
> To: CF-Talk
> Subject: Replace() vs. ReplaceNoCase()
>
> Would I be correct in assuming that Replace() is a bit more
> efficient than
> ReplaceNoCase() since Replace() wouldn't first need to do a
> case change on
> the target string?
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to