In addition to several fixes and improved error detection and messages (thanks Alexey Kasantsev), the DWScript SVN version now includes string concatenation improvement for the common “s := s + …” case.
Just for illustration, the execution times for the following test snippet
for i:=1 to 5000000 do buf := buf + IntToStr(i);
are right now on my machine:
- Delphi: 670 ms
- C#: 910 ms (using StringBuilder)
- DWScript: 1430 ms
- C#: like… forever (using string concatenation)
and when appending constant strings
for i:=1 to 5000000 do buf := buf + 'abc';
the timings are:
- Delphi: 150 ms
- C#: 170 ms (using StringBuilder)
- DWScript: 220 ms
I didn’t include PascalScript, as its execution times were too long, in both cases.
Oddly enough, it’s now faster to concatenate using the “s:=s+…” or “s+=…” patterns than using TStringBuilder. This is in part thanks to FastMM, in part because of TStringBuilder, and in part because TStringBuilder does not yet benefit from a “fast path” in DWScript.