Re: Offset vs. Repeat loops
Re: Offset vs. Repeat loops
- Subject: Re: Offset vs. Repeat loops
- From: Michelle Steiner <email@hidden>
- Date: Sun, 8 Jul 2001 17:27:28 -0700
On 7/6/01 4:47 PM, Greg Strange <email@hidden> wrote:
>
Michelle posted an excellent handler for changing strings form upper to
>
lowercase and vice versa. I thought it good but I thought that getting the
>
offset of one in the other string faster given that you don't have to loop
>
through every character. The difference was amazing. Michelle's mod
>
finished 1000 iterations in 518 ticks (on average through five overall
>
runs). Mine posted below did 1000 iterations in 2321 ticks (on average
>
through five overall runs)!
>
>
Why is offset so much slower than repeat loops? That seems
>
counterintuitive. (Mind the wraps!)
Your script loops through the entire string to be changed. My script
loops through only 26 characters. If the string to be changed has more
than 26 characters, your script will be slower than mine.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------