4 ms·
I was under the impression that it wasn't for performance but for distribution, i.e., to optimize for app size. Instead of having a fat binary crosscompiled for
by anonova 7y ago
I was under the impression that it wasn't for performance but for distribution, i.e., to optimize for app size. Instead of having a fat binary crosscompiled for different architectures, Apple uses the bitcode to compile and distribute per architecture. It's part of the "app thinning" process.
- bluejekyll 7y agoI think you’re right that that is the primary reason today. In their marketing material I think they always use the term “reoptimize”, of course, that can mean for size. Thanks for the correction.
- MaxGabriel 7y agoTo expand on this, it also lets them target new CPU architectures without having developers recompile code for that architecture. This lets them make incremental improvements (eg armv7), but would also let them use their own CPU architecture should they move away from Intel/ARM. As an example here’s Chris Lattner tweeting about that use case: https://twitter.com/clattner_llvm/status/1091186386634326017?s=21 https://twitter.com/clattner_llvm/status/1091186386634326017...
- saagarjha 7y ago> but would also let them use their own CPU architecture should they move away from Intel/ARM Only if their new architecture looked a lot like Intel/ARM. Bitcode can’t paper over all architectural differences.
- pjmlp 7y agoRegular bitcode cannot do it. However Apple has naturally customized it for their own purposes. Not everything that Apple does lands on upstream.
- deleted 7y ago[deleted]
- ajconway 7y agoApp Thinning works just as well without bitcode. It’s just a process of removing unneeded architecture slices and resource variants from a downloadable app.
- yyyk 7y agoI guess this is good enough for Apple in practice, but LLVM bitcode is not platform independent in general.