4 ms·
It's not only about memory: "In short, the improvements to Apple's runtime make it so that object allocation in 64-bit mode costs only 40-50% of what it does i
by terhechte 12y ago
It's not only about memory:
"In short, the improvements to Apple's runtime make it so that object allocation in 64-bit mode costs only 40-50% of what it does in 32-bit mode. If your app creates and destroys a lot of objects, that's a big deal." [1]
One example: in 64bit NSNumber and (short) NSString objects on iOS can be stored completely in a pointer (tagged pointers) on the stack without having to create anything on the heap. That's possible because the size of a 64bit pointer is large enough to contain the required information. Creating and accessing one of these objects becomes far faster. Based on what I gathered at WWDC this year, Apple is also inclined to move as many various objects there as possible (as long as they can be stored in a 64 bit pointer).
[1] https://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html https://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-an...
- DCKing 12y agoIt is worth noting that this is likely to be an iOS-on-AArch64 specific tweak. Apple doesn't do this on x64 OS X (right?). Furthermore, nothing has been said (AFAIK) about similar tricks Google is doing with Android on AArch64 or 64 bit architectures in general. From what I've heard they just made the Android runtime capable of emitting AArch64 (and x64, MIPS64) instructions instead of 32-bit ARMv7 ones. That alone gives plenty of a performance boost as AArch64 instructions are supposedly quite a bit faster than the old 32-bit ones. It remains to be seen though whether Google can make as much use of clever allocation tricks as much as Apple can: Android is much more platform agnostic and uses a garbage collector for some of these tasks.
- pjmlp 12y agoGoogle is already doing it in ART. ART also brings a new GC, which is quite improved compared to the fossilized Dalvik version that has barely changed since Android 2.3.
- pohl 12y agoThere is nothing iOS specific about it. MacOS X has been benefiting from this optimization since 10.7.
- DCKing 12y agoI stand corrected. So it's a feature of Apple's runtime on all 64 bit systems.