In JavaScript usually there is no need for a StringBuilder. Are you sure it helps the performance? AFAIK += for strings is fast in every browser, it's only necessary if you implement batch operations, eg. a batchAppend(string[]) method.
Hmm... you might be right. I had not gotten around to tuning perf yet. The main idea was to abstract the string building, so that if some technique is found to be faster, we only need to change one place.
Looks like the TypeScript compiler has an EmitTextWriter abstraction, but its inner loop just uses +=.
Most helpful comment
Hmm... you might be right. I had not gotten around to tuning perf yet. The main idea was to abstract the string building, so that if some technique is found to be faster, we only need to change one place.
Looks like the TypeScript compiler has an
EmitTextWriterabstraction, but its inner loop just uses+=.