Site hosted by Angelfire.com: Build your free website today!
Remember to show that there are *two* major chokepoints in string operations. One goin' in, one comin out. It doesn't just choke, it gets asthma.

Overview of String Articles

Introduction

Articles

  1. Why String Operations are so Slow
    The first article discusss why string operations are slow in both VBScript and VB, and provides performance graphs showing that, for many operations, the execution time increases with the square of the length of the target string, when it should be increasing at the same rate as the length of the target string.
     
  2. Faster string functions in VBScript
    This article provides source code for (and discussion of) several routines which will improve string performance in VBScript. Note that, in some cases, the performance improvements are only modest (as VBScript doesn't have a Mid statement, only a Mid function).
     
  3. Faster string functions in VB
    This article provides source code for (and discussion of) several routines which will greatly improve string performance in VB. While some of these routines perform worse than the built-in ones (for small strings), they all perform MUCH better for long strings, or very repetitive sequences of operations. Many have linear performance. So instead of taking 100 times longer to process 10 times the data, they take 10 times longer. Some (like the string concatenation routines) do not do so well. These have N*log(N) performance, and will take about 33 times longer to process 10 times the data.
    Code Examples:
    1. InstrNext() - a function which finds the next occurrence of a substring in a string (when given the index of the previous one).
    2. InstrAfter() - a function which find the *end* of the next occurrence of a substring in a string.
    3. LinearJoin() - a version of Join() which scales better for very large arrays.
    4. LinearSplit() - a version of Split() which scales better for very large arrays, and performs much better for case-insensitive splits.
    5. LinearReplace() - a version of Replace() which performs much better for case insensitive string-replacement, and scales better for ordinary string-replpacement
    6. LinearFind() - a routine which finds occurrences of a substring in another string, *without* creating new strings or making copies of the old
    7. clsConcatenatedString() - a class that helps you concatenate strings faster (it gives N*Log(N) performance).
    8. clsLinearString() - a class that concatenates strings even faster (and gives linear performance even for VERY long strings).This one will scale up to about 110Mb. The other class only scales to about 2Mb.

  4. Identifying string performance bottlenecks
     
  5. Avoiding string operations altogether