From: Kem Tekinay <[EMAIL PROTECTED]>
Date: Mon, 12 Feb 2007 00:17:34 -0500

I know this has probably been done to death, but I wanted emphasize how slow
strings are in REALbasic for appends. Consider this code, for example:

    for i as integer = 1 to 50000
      s = s + str( i )
    next i

This takes 17 seconds to run in a compiled app on a PowerMac G5 dual-2.5
GHz.

Meanwhile, I took about an hour to create a custom class called FastString

Dude... I'm using that name already.

http://www.elfdata.com/plugin/technicalref/FastString.html

I've been using it for about 4 years now.

that uses an array to hold the parts of the string. By defining the
Operator_Add and Operator_Convert methods, I can change s above from a
string to a FastString, and the exact same code takes 0.1 seconds! If I rewrite the code to use a method within FastString, it takes half that:

    for i as integer = 1 to 50000
      s.Append( str( i ) )
    next i

OK, so part of this is bragging, but the more serious question is, if I could do this in an hour, why can't RB use the same behavior in its native
strings?

My FastString is just as easy to use, if not easier, and more sophisticated, and faster.

And it didn't take an hour to make. It took many months of evolution. NOt continual hard work because the idea is simple, but the evolution into making it as streamlined, fast and easy to use as possible took a lot of time.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to