OpenGL code optimization
if CPU is the problem then the number of sprites im drawing would have to be large because Im not doing anything else than loadidentity() translate rotate scale draw again and again.
What should I profile and how?
What should I profile and how?
Sir, e^iπ + 1 = 0, hence God exists; reply!
We clearly need a Shark tutorial soon. 
Assuming you have the CHUD tools installed (/Developer/Applications/Performance Tools), fire up Shark. There'll be a small window with a big button saying Start. Start your game, hit Option+Esc to start Shark in the background. Run the game for 30 seconds, then Shark will say boing, and start chewing the results for an eternity. Then, you'll see a breakdown of what's taking time in your application. Tell us what is the top entry, and let's see what's happening. If it turns out to be an OpenGL call we'll break out the OpenGL profiler, and see where we can take this baby.

Assuming you have the CHUD tools installed (/Developer/Applications/Performance Tools), fire up Shark. There'll be a small window with a big button saying Start. Start your game, hit Option+Esc to start Shark in the background. Run the game for 30 seconds, then Shark will say boing, and start chewing the results for an eternity. Then, you'll see a breakdown of what's taking time in your application. Tell us what is the top entry, and let's see what's happening. If it turns out to be an OpenGL call we'll break out the OpenGL profiler, and see where we can take this baby.
Sounds fun!
Ill do that
Ill do that
Sir, e^iπ + 1 = 0, hence God exists; reply!
Here is the shark file, i dont really know what it to make of it but the top line is
If its any use http://www.geocities.com/ed72678954/session01.shark.zip is the shark file.
Code:
97% machine_idle_ret
97% machine_idle_ret
97% idle_thread_continueIf its any use http://www.geocities.com/ed72678954/session01.shark.zip is the shark file.
Sir, e^iπ + 1 = 0, hence God exists; reply!
Hm, odd. Did you make sure to set the Process popup to All, and the Thread popup to all? They're both at the bottom.
Well, I am loading the application from the terminal but with Process All the top few lines are
Hope you can make more sense of that than me!
Code:
61.4% machine_idle_reset mach_kernel
97% machine_idle
97% idle_thread_continue
9.9% ml_set_interrupts_enabled mach_kernel
1.1% gldFreeVertexBuffer GeForceMX2GLDriver
gldUpdate.. GLEngine
dylid_stub.. GLEngine
dylid_stub.. GLEngine
drawCircle MyGame
1.1% luaV_execute MyGame
0.7% UNREADABLE_PAGE 0x00277000 NO_LIBRARYHope you can make more sense of that than me!
Sir, e^iπ + 1 = 0, hence God exists; reply!
so your game is using virtually no CPU time. It's probably worth using a system trace profile in shark to see which system calls are taking up your time (look on the timeline view) (system trace is new in shark 4.2.0a15)
Shark 3.5.1, Dammit!
Where can I find an update?
Will it run om my measly os 10.3.9?
Where can I find an update?
Will it run om my measly os 10.3.9?
Quote:In my experience, when drawing with alpha testing (rather than blending), you only pay for the pixels which actually got drawn. With that in mind, drawing a 128x128 sprite which only has a 40x40 area containing opaque pixels would seem to be a bit silly, but shouldn't slow you down massively. It still makes sense to use a more optimal texture size if you can.No, im the textures are that big but get scaled to 40x40, the opaque pixels take up 3.141*64*64 pixels
Sir, e^iπ + 1 = 0, hence God exists; reply!
No, I don't think Shark 4.2 will work on 10.3.9... can anyone confirm?
Time to upgrade to 10.4
http://developer.apple.com/tools/download/
Time to upgrade to 10.4

http://developer.apple.com/tools/download/
Haha, I think ill have to make some money designing websites or somthing for a while before I can pay for it.
hmm, might get a new graphics card and some more ram too.
The DMG wont even mount, thats so cruel.
hmm, might get a new graphics card and some more ram too.
The DMG wont even mount, thats so cruel.
Sir, e^iπ + 1 = 0, hence God exists; reply!
If you can't upgrade to 10.4, there are two ways to come close to the system trace profile. The function trace can trace system calls, but only for your program. The time profile can be set to profile everything so you can find a problem outside of your program.
For those of you interested in a Shark tutorial, I placed an old version of my new book's Shark chapter on my website. Go to http://www.meandmark.com/xcodebook.html to read the chapter. The chapter was written for Shark 4.1. I know Shark 4.0 will run on Mac OS X 10.3.9, and there weren't many changes between 4.0 and 4.1.
For those of you interested in a Shark tutorial, I placed an old version of my new book's Shark chapter on my website. Go to http://www.meandmark.com/xcodebook.html to read the chapter. The chapter was written for Shark 4.1. I know Shark 4.0 will run on Mac OS X 10.3.9, and there weren't many changes between 4.0 and 4.1.
Cool, thanks a lot.
Ive downloaded your tutorial and ill get 4.0.
Ive downloaded your tutorial and ill get 4.0.
Sir, e^iπ + 1 = 0, hence God exists; reply!
just wondering... have you read Apple's tech note on OpenGL performance optimization?
So heres a good way to optimize a game for speed, reduce the texture size from 512x512....At least its running over 100 fps now!
Sir, e^iπ + 1 = 0, hence God exists; reply!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Simple ray-face intersect optimization | NYGhost | 8 | 4,649 |
Aug 17, 2007 12:01 PM Last Post: NYGhost |
|
| NEED HELP! OpenGL code for my exam doesn't work | mr02077 | 2 | 2,401 |
Feb 9, 2007 05:44 PM Last Post: stevejohnson |
|
| SDL/OpenGL Initialization Code | Nick | 15 | 6,558 |
Sep 7, 2005 07:28 AM Last Post: Nick |
|
| OpenGL Source Code Generator | Leisure Suit Lurie | 2 | 3,262 |
Jul 5, 2005 11:55 AM Last Post: Cochrane |
|
| bus error with opengl code | mnorton | 2 | 3,216 |
Jan 21, 2005 02:53 PM Last Post: ThemsAllTook |
|

