ANN: Remove double spaces--plugin

Mark Smith mark at maseurope.net
Mon Dec 5 08:48:50 EST 2005


Jim, I hope you didn't take my little experiment as some kind of one- 
upmanship - it certainly wasn't intended as such.
I was simply interested to see, in this example of removing double- 
spaces, how great the difference was between the more flexible regex  
approach, and the more specific "replace" approach.

As you suggest, with blocks of text of a few thousand characters,  
there's clearly little benefit to be had from chasing a  millisecond  
or two, but with larger blocks, or with batches of blocks, it might  
well be useful to know that one method is ten times faster than another.

Apologies if misconstrued,

Mark

On 5 Dec 2005, at 11:14, Jim Ault wrote:

> Ooooops      I clicked 'send' too quickly...  That should read:
>
> Approximation:
> A text block containing 1700 characters, 50% of which were spaces,  
> would
> take about
> *2 milliseconds*
> to use ReplaceText pattern searching,
> which is 10 times slower than the Replace technique you programmed.
>
> Jim Ault
>
> On 12/5/05 2:58 AM, "Jim Ault" <JimAultWins at yahoo.com> wrote:
>
>> Interesting, Mark.  Good example. [see code below in original post]
>> So 20 milliseconds   div  10,000 space runs
>> = 2.0 x 10^-2  seconds  div  1.0 x 10^4  =  2.0 x 10^-6 seconds
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list