Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I only remember a very early review of string operation speeds that was pretty bad at times indeed. But that was about Swift 1 and the string implementation has been changed a few times. Do you have any recent source?



Personal experience making the same command line util in python and swift 3 that was parsing code with the same C library (sourcekit) and then doing a bunch of string manipulation after that.

Optimized swift 3 & python were the same speed, with %80 of the time being spent in the C library. I would expect swift would at least be 2x faster in that %20 portion that wasn't sourcekit library.


I think strings in Swift are primarily meant to be very correct above being fast or easy to use. It's more strict than both Python 2 and 3. Handling of languages that use really complex character compositions springs to mind.


There is no obvious way to turn that off fortunately, when you don't need it.


I think it's coming. Part of the String Manifesto Apple has is that they want to give both worlds.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: