2 ms·
Is the memory representation of Swift strings now documented as something that programmers can rely on for performance characteristics? I read the Swift Book w
by hsivonen 10y ago
Is the memory representation of Swift strings now documented as something that programmers can rely on for performance characteristics?
I read the Swift Book when Swift first came out and it bothered me a lot that the book didn't say what the memory representation of strings is. In contrast, Rust documentation is very clear about this stuff.
- Manishearth 10y agoIt's a tagged union of utf8 and utf16 IIRC. I had to look at the stdlib source when I was trying to figure this out.