3 ms·
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 i
by bsaul 4y ago
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..
- deleted 4y ago[deleted]
- msbarnett 4y agoReading anything at all into the relative performance of these programs written by different people which are all doing radically different things seems like a gigantic waste of time. 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.
- bsaul 4y agoi was wondering if this was due to unicode indeed. I had hoped that the benchmarks required languages to perform the same kinds of string check, otherwise there's really no point indeed.
- saagarjha 4y agoIn case you miss it: https://news.ycombinator.com/item?id=32220587 https://news.ycombinator.com/item?id=32220587