FastString

( )
4 Votes

The FastString class is stringbuilder implementation. It is used to append many short strings into one long string. The difference between the FastString class and using A = A & "Kalle" in VB is the speed. One application for it is in web-components that needs to generate HTML or XML as return values.

Here are some performance data:

Task VB [s] FastString [s]
Appending a 10 character long string 10000 times 0.5915 0.0196
Appending a 10 character long string 20000 times 2.2230 0.0508
Appending a 10 character long string 30000 times 9.9740 0.0801
Appending a 10 character long string 40000 times 28.3509 0.0897
Appending a 10 character long string 50000 times 52.4963 0.1292

Download Donate License

Be the first to leve a comment or ask a question about the code!

The interface:

  • append(Data as String)
    Appends the string Data to the internal buffer.
  • toString() as String
    Returns the internal buffer as a string.
  • toByte() as Byte()
    Returns the internal buffer as a byte array.

Do you want your organization to take off
or are you happy as long as it doesn't drop?
With participation and motivated staff you organization can get airborne!

Last update Tuesday, August 07, 2007
Copyright © 2006 Datomatic. All rights reserved

Powered by umbraco