surprised to see swift 4 times as slow as non-optimized go.
Anyone has an explanation ?
I know the swift string type is really complex, but i always assumed it was at least performing well..
Anyone has an explanation ?
I know the swift string type is really complex, but i always assumed it was at least performing well..
Some of these “simple” versions are custom-specifying allocators to minimize memory overhead and doing highly optimizable ASCII value manipulations and doing byte-equality on strings, rather than go through slower Unicode libraries. The “simple” Swift version is doing nothing at all to avoid generating many allocations/deallocations and running fully Unicode-aware algorithms to lower the input and perform Unicode-normalized string comparisons, it’s totally apples-to-oranges stuff.