|
largewc 发表于 2013-10-31 22:11
mempool我们有的,只是对小额内存和相对尺寸固定的有用
物理的数组都是不确定长度的,引用的对象更是 ...
实在无法连续分配内存的情况下,可以通过手工prefetch优化。像我前面提的二叉树查找,如果bullet有的话就可以手工prefetch优化。
btw:A7的64位模式下对象的创建和销毁是有大幅性能提升的
http://www.mikeash.com/pyblog/fr ... -arm64-and-you.html
Adding it all together, it's a pretty big win. My casual benchmarking indicates that basic object creation and destruction takes about 380ns on a 5S running in 32-bit mode, while it's only about 200ns when running in 64-bit mode. If any instance of the class has ever had a weak reference and an associated object set, the 32-bit time rises to about 480ns, while the 64-bit time remains around 200ns for any instances that were not themselves the target.
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. |
|