Okay, I think I'm brain damaged -- nope, I figured it out

Geoff Canyon gcanyon at gmail.com
Sat Sep 14 02:52:56 EDT 2013


Can you post your code? I didn't see that. Here's mine for the two tests I
did, and a simple put after looks 50% faster (90mb vs. 60mb):

Variable by reference:

60000000

on mouseUp
   put 10 + the long seconds into T
   repeat
      repeat 100000
         append "xxxxxxxxxx", R
      end repeat
      if the long seconds > T then exit repeat
   end repeat
   put length(R) & cr & cr & the script of me
end mouseUp


command append pNew, @pString
    put pNew after pString
end append




Simple put after:

90000000

on mouseUp
   put 10 + the long seconds into T
   repeat
      repeat 100000
         put "xxxxxxxxxx" after R
      end repeat
      if the long seconds > T then exit repeat
   end repeat
   put length(R) & cr & cr & the script of me
end mouseUp



On Sat, Sep 14, 2013 at 1:10 AM, Mark Wieder <mwieder at ahsoftware.net> wrote:

> Geoff-
>
> Friday, September 13, 2013, 11:01:56 PM, you wrote:
>
> > I'm pretty sure put after does not make a copy. It does have to find the
> > end of the string in order to append to it. I did timings, I'll post the
> > results in a minute...
>
> Nonetheless, the solution I posted using a variable by reference is
> two orders of magnitude faster by my experiments.
>
> --
> -Mark Wieder
>  mwieder at ahsoftware.net
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list