Will my iPhone app take a performance hit if I use Objective-C for low level code?

后端 未结 8 1995
生来不讨喜
生来不讨喜 2020-12-04 07:57

When programming a CPU intensive or GPU intensive application on the iPhone or other portable hardware, you have to make wise algorithmic decisions to make your code fast.

8条回答
  •  孤城傲影
    2020-12-04 08:14

    yes. c++ reign supreme in performance/expresiveness/resource tradeoff.

    "I'm looking for hard data, not evangelism". google is your best friend.

    1. obj-c nsstring is swapped with c++'s by apple enginneers for performance. in a resource constrained devices, only c++ cuts it as a MAINSTREAM oop language. NSString stringWithFormat is slow

    2. obj-c oop abstraction is deconstructed into procedural-based c-structs for performance, otherwise a MAGNITUDE order slower than java! the author is also aware of message caching - yet no-go. so modeling lots of small players/enemies objects is done in oop with c++ or else, lots of Procedural structs with a simple OOP wrapper around it with obj-c. there can be one paradigm that equates Procedural + Object-Oriented Programming = obj-c. http://ejourneyman.wordpress.com/2008/04/23/writing-a-ray-tracer-for-cocoa-objective-c/

提交回复
热议问题