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
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?
__________________________________________________________________________
Kem Tekinay (212) 201-1465
MacTechnologies Consulting Fax (914) 242-7294
http://www.mactechnologies.com Pager (917) 491-5546
To join the MacTechnologies Consulting mailing list, send an e-mail to:
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>