Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-02-2012, 06:43 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default C++/Objective C performance

I'm trying to gauge an idea of how much faster my code might be if I switch over from using Objective C/NSObject to a C++ framework for my game. I've heard different stories from comparable to a drastically different and I'd like to get an idea of the % increase in speed I might get. I know this is a vague question and depends on a bunch of things, so any clarification about this would be appreciated. I'm at a point where my game is running right around 30 CFPS, and I'd like to add more stuff without dropping the frame rate.

Worth mentioning is I'm using Opengl ES 2.0 and not particularly interested in porting what I have to Android anytime soon, so any motivation to convert what I have to C++ would be for speed, not cross platform reasons.
mer10 is online now   Reply With Quote
Old 02-03-2012, 09:23 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 261
vbovio is on a distinguished road
Default

I have a bit more than 5 years working with ObjC/Cocoa, and I can tell you it is slower than C++, the strong reason for ObjC is that it is an easy, modern and nice language to use, compared to old C++.
So for a game, I would go C/C++ only. Although I think you can use ObjC too, just don't abuse objects, if you start using many arrays, dictionaries, sets, strings, etc, specially if you do things like an NSArray of NSArrays, you can easily slow performance and memory.
Another strong factor for me is cross platform, maybe you don't care now and that's okay, but talking about games, iOS is not the only platform, there are many.
__________________
BovioSoft Games
vbovio is offline   Reply With Quote
Old 02-03-2012, 09:30 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by vbovio View Post
I have a bit more than 5 years working with ObjC/Cocoa, and I can tell you it is slower than C++, the strong reason for ObjC is that it is an easy, modern and nice language to use, compared to old C++.
So for a game, I would go C/C++ only. Although I think you can use ObjC too, just don't abuse objects, if you start using many arrays, dictionaries, sets, strings, etc, specially if you do things like an NSArray of NSArrays, you can easily slow performance and memory.
Another strong factor for me is cross platform, maybe you don't care now and that's okay, but talking about games, iOS is not the only platform, there are many.
How much % faster would you say it is?
mer10 is online now   Reply With Quote
Old 02-03-2012, 09:46 AM   #4 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 261
vbovio is on a distinguished road
Default

sorry, can't tell how much %, it depends on the game size, how you code it and how many objects you used.
__________________
BovioSoft Games
vbovio is offline   Reply With Quote
Reply

Bookmarks

Tags
c++, c++ objective c

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 384
8 members and 376 guests
apatsufas, comicool, dansparrow, husthlj, LunarMoon, mer10, Murphy, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,677
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, husthlj
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0