On Tuesday, 19 July 2016 at 16:01:01 UTC, Lodovico Giaretta wrote:
On Tuesday, 19 July 2016 at 15:48:26 UTC, Atila Neves wrote:
Small string optimization should _help_ std::string, no?
Atila
Small string optimization will make the struct bigger, thus
making swapping slower. If the struct is no bigger than 2
pointers, swapping it is ultra fast.
Interesting. Read up on it and tried changing the strings to be
~50 chars long. C++/std::string gets better, but C++/const char*
still beats D by a small margin:
C: 1.852s
C++/std::string: 1.489s
C++/const char*: 1.034s
D: 1.188s
Could be the cost of swapping the "fat" in "fat pointer", in
which case: worth it.
Atila