Chinaunix首页 | 论坛 | 博客
  • 博客访问: 138661
  • 博文数量: 52
  • 博客积分: 863
  • 博客等级: 准尉
  • 技术积分: 510
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-24 17:54
个人简介

没有人生,没有爱情!

文章分类

全部博文(52)

文章存档

2014年(9)

2013年(20)

2012年(17)

2011年(6)

我的朋友

分类: C/C++

2011-12-28 21:16:42

by Originally posted: May 20, 2009

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  , and  instructions are .  By default, your Xcode project will compile with .

Why use Thumb instructions?On  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.)
compile_for_thumb_option-300x294
6. Clean and rebuild your project.


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!
阅读(1287) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~