The CP function code being far faster than the CHANGE native function is
interesting.

Was having B declared outside of CP crucial or was it just to avoid a
potential unfair function overhead on CP?
Both seem very quick. How did you measure the difference in speed?
As you increase the size of the sample string or change the reference points
to change/copy, is there changes in the results?
What of blocks instead of strings?

Brett.


----- Original Message -----
From: "Ladislav Mecir" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 15, 2001 11:57 AM
Subject: [REBOL] Re: newlines


> Hi all,
>
> according to my measurements the CP function defined as follows:
>
> use [b] [
>     b: make string! 1'000
>     cp: func [
>         string [any-string!]
>         value [any-string!]
>         range [any-string! integer!]
>     ] [
>         change string head insert/part clear b value range
>     ]
> ]
>
> Where:
>
>     sample: insert/dup "" #"x" 30'000
>
> Used as:
>
>     cp sample skip sample 1'000 skip sample 2'000
>
> is almost 100 times faster than:
>
>     change/part sample skip sample 1'000 skip sample 2'000
>
> Any comments?
>
> Cheers
>     Ladislav
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to