Re: ObjC in time-critical parts of the code
Re: ObjC in time-critical parts of the code
- Subject: Re: ObjC in time-critical parts of the code
- From: Bill Bumgarner <email@hidden>
- Date: Mon, 19 Jan 2009 16:35:21 -0800
On Jan 19, 2009, at 4:21 PM, Kyle Sluder wrote:
On Sun, Jan 18, 2009 at 7:10 PM, Bill Bumgarner <email@hidden> wrote:
Simple question: Is it better to pursue a 20%, or even 50%,
improvement in
drawing speed by rewriting in C++ or C than, say, preventing the 2,
3, 4, or
more extra redraws that are happening prior to window flush?
Don't laugh
-- I have seen it happen. Often.
This just got posted to programming.reddit.com: "My iPhone is not a
Mac Pro": http://www.reddit.com/r/programming/comments/7qxuv/my_iphone_is_not_a_mac_pro_speeding_up_iphone/
In it, the author discusses improving the speed of his iPhone app.
Importantly, he starts by improving the data structure in which he
stores the app's data, and then improving the algorithms used to
access that data. Eventually he employs some C++ to get a significant
speed boost, but the decision has *nothing* to do with non-virtual
member functions or other such oft-touted C++ speed improvements -- in
fact, he compares it to using -[NSArray
sortedArrayUsingFunction:context:], which doesn't incur the ObjC
dispatch overhead. It's all about the algorithm, and C++ happened to
have one he could use that improved his code's speed.
Which, of course, would be an utterly pointless optimization if it
were merely to make the extra-3-unnecessary-redraws fast enough to
boost his framerate to something acceptable (which was the point of
the part of my post that you excerpted :).
Fortunately, it sounds like the author of the original article
actually figured out that they had eked out ever last bit of
performance from the APIs and, thus, pursued a hybrid solution
leveraging C++.
Nice article.
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden