iPhone OpenGL Speed Tip
来源:互联网 发布:手机虚拟定位软件 编辑:程序博客网 时间:2024/05/14 00:04
Xcode Thumb
Turn off thumb compilation in XCode for ARMv6, but turn it on for ARMv7.
- Thumb compiling creates smaller compiled sizes at the threat to floating point math
- Thumb code is MUCH slower than the non-thumb code
- Instructions to change this setting on a project
Want to boost your iPhone OpenGL app’s framerate with one checkbox? It’s easy; turn off Thumb instructions.
What are Thumb instructions?
The iPhone uses the ARM 1176JZ processor, and Thumb instructions are 16-bit versions of common 32-bit ARM instructions. By default, your Xcode project will compile with Thumb instructions.
Why use Thumb instructions?
On embedded systems like the iPhone (or any system, really, but here especially), you have to think about the space your app uses. Smaller instructions mean smaller code in memory and on disk. That’s a good thing! However, there’s a trade-off: performance.
According to Apple, the cost comes from floating-point operations. Ripping out the GLfloats from your app isn’t the way to go, so let’s learn a better way.
How do I turn off Thumb instructions?
Here’s what to do in Xcode:
1. Open your project
2. Choose Project -> Edit Project Settings
3. In the Project Info window, choose the Build tab
4. In the search box, type “thumb“
5. You should see a “Compile for Thumb” setting. Uncheck it. (Click image to enlarge.)
That’s it! If you don’t have the setting, make sure the Active SDK is set to Device. The setting isn’t applicable to the Simulator.
What kind of frame rate boost will I see?
I had improvements of around 20, 30, and 50%. Hopefully you will see even bigger ones!
- iPhone OpenGL Speed Tip
- IOS IPhone开发的tip记录
- iPhone OpenGL ES教程
- iphone opengl es 截图
- iPhone OpenGL ES教程
- OpenGL ES for iPhone
- iphone opengl环境搭建
- speed
- tip
- Tip
- tip
- Tip:
- TIP
- Tip
- tip
- Tip
- Tip
- tip
- /dev/null Read-only file system 系统无法启动 (转)
- 一个java开发超有用的网站
- jQuery 核心函数
- 为JAVA性能而设计(3)
- css实现div内图片的垂直、水平居中
- iPhone OpenGL Speed Tip
- 15款提高工作效率的工具分享
- Java性能设计
- CRM项目半途而废 “烂摊子”该如何收拾?
- 如何安装声卡驱动!
- Android ArrayAdapter 详解
- jsp下载文件的method
- Python notes
- 如何设置BIOS