It is simply an optimized utf8. That’s why’s fast
I’ve just been looking at D.
Out of curiosity I thought I’d try this benchmark:
import std.stdio;
import std.array;
import std.datetime.stopwatch;
void main() {
auto sw = StopWatch(AutoStart.no);
sw.start();
string myTestString = "1230,345,456,6780,789,901,1240,346,457,5680,679,345,4560,678,789,9010,124,346,4570,568,679,";
for ( int i = 0; i <= 10000000; i++ ) {
string[] sTagsArray = split(myTestString, ",");
ulong kk = sTagsArray.length;
for ( int j = 0; j < kk; j++ ) {
string sNewString = sTagsArray[j];
}
}
sw.stop();
double secs = sw.peek.total!"msecs" / 1000;
writeln(secs);
}
On the same mini PC described above the result was 18 seconds.