(no title)
ppeetteerr | 1 month ago
The other point I've seen is that its string library is slow and very accurate.
Besides that, the C-interop means you have quite a bit of flexibility in leveraging existing libraries.
ppeetteerr | 1 month ago
The other point I've seen is that its string library is slow and very accurate.
Besides that, the C-interop means you have quite a bit of flexibility in leveraging existing libraries.
fauigerzigerk|1 month ago
Swift strings default to operating on grapheme clusters, which is relatively slow. But you can always choose to work with the underlying UTF-8 representation or with unicode scalars, which is fast.
The only situation where UTF-8 incurs overhead is if the String comes from some old Objective-C API that gives you a UTF-16 encoded String.
zozbot234|1 month ago
The unicode-segmentation crate implements this for Rust, in case it matters for accuracy.
wahnfrieden|1 month ago
That’s how I took over maintenance of SwiftSoup and made it over 10x faster according to my benchmarks. Besides various other optimizations such as reducing copying, adding indexes, etc.
ComputerGuru|1 month ago
ppeetteerr|1 month ago
wahnfrieden|1 month ago
It also has C++ interop btw