2 ms·
Reading anything at all into the relative performance of these programs written by different people which are all doing radically different things seems like a
by msbarnett 4y ago
Reading 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.