measurement resolution, the tests are executed in loops of increasing size. The basic timer
being used (via the Date object) has greater than 1 ms resolution, so we need to execute
about 1000 iterations to get near 1 us (micro-second) resolution.
from the subsequent tests to isolate the cost of the statements being executed (subtracting
away the overhead of the test harness).
February 16, 2006
The following tests show a factor from 6 to 40 times better performance in IE6 when using the StBuf
class instead of a generic string variable for concatenating 100's of strings (on my machine,
concatenating 4,000 strings takes nearly 5 seconds in IE6, whereas the StBuf takes about 0.1 seconds!).
On Firefox, the built-in String concatenation operator is faster than the StBuf class - but not
by much. In fact, for very large numbers of strings (100,000's), the StBuf class and String
perform about the same.
this.rgst = new Array;
StBuf.prototype.Append = function(st)
StBuf.prototype.toString = function()
- Mike Koss