3 ms·
The Swift compiler does some of the optimizations/techniques you mention Rust does. It won't reference count, when the setup is possible to analyze statically a
by BulgarianIdiot 4y ago
The Swift compiler does some of the optimizations/techniques you mention Rust does. It won't reference count, when the setup is possible to analyze statically and elide ref count. Swift also has widely used complex value types, which are stored on the stack. It will also even put some reference types on the stack after doing escape analysis etc.
I don't know which benchmark to trust anymore, but for some reason iOS software tends to seemingly overperform comparable ART (GC) code.
- saagarjha 4y agoValue types are stored wherever appropriate. If they escape they’re going on the heap like everything else.
- BulgarianIdiot 4y agoIf they are very large and implement copy-on-write, sure, parts of them may be on the heap. But they don't need to be on the heap if they escape if they're just returned by copy.
- saagarjha 4y agos/very large/a couple of words/