Weird framerate problem

Jesse
Unregistered
 
Post: #1
I'm starting to get a handle on tweaking OpenGL's performance, but I've got a strange problem that is making it difficult to measure the results. Sometimes when I recompile (with no significant change in code) the frame rate drops from over a hundred to under thirty or worse. When I quit the compiler (Codewarrior) and run the program as a stand-alone app, the problem persists. Restarting the computer usually clears it up, but the problem reappears eventually. Here's my system info:

Codewarrior 4.2.5
G4 Dual 800
OS 9.2.2
GeForce 2 Twinview

For example, I just ran the app from Codewarrior three times in a row, recompiling in between. The only change I made was to comment/uncomment a line of code that wasn't doing anything. The first time it ran around 140, then dropped to 90, then 30. After quitting Codewarrior, the app still ran at 30 fps. Then I restarted my computer and ran the app again - back to 140. This happens whether or not profiling is turned on.

I plan on doing some controlled tests to see if I can indentify the problem through profiling, but I thought I'd ask here also in case this is something common, or if there's something obvious I'm overlooking. Any ideas?

Thanks,

Jesse
Quote this message in a reply
Moderator
Posts: 434
Joined: 2002.09
Post: #2
Quote:Originally posted by Jesse
I'm starting to get a handle on tweaking OpenGL's performance, but I've got a strange problem that is making it difficult to measure the results. Sometimes when I recompile (with no significant change in code) the frame rate drops from over a hundred to under thirty or worse. When I quit the compiler (Codewarrior) and run the program as a stand-alone app, the problem persists. Restarting the computer usually clears it up, but the problem reappears eventually. Here's my system info:

Codewarrior 4.2.5
G4 Dual 800
OS 9.2.2
GeForce 2 Twinview

For example, I just ran the app from Codewarrior three times in a row, recompiling in between. The only change I made was to comment/uncomment a line of code that wasn't doing anything. The first time it ran around 140, then dropped to 90, then 30. After quitting Codewarrior, the app still ran at 30 fps. Then I restarted my computer and ran the app again - back to 140. This happens whether or not profiling is turned on.

I plan on doing some controlled tests to see if I can indentify the problem through profiling, but I thought I'd ask here also in case this is something common, or if there's something obvious I'm overlooking. Any ideas?

Thanks,

Jesse


I'm not familiar with this problem but that won't stop me from speculating.

I'm wondering if the Codewarrior debugger is leaking a thread or process. Are you quitting your application politely, or are you telling the debugger to interrupt it? Also look for other resources being used up: does available system memory go down each time it happens?

You might also try to isolate it to either the compiler, debugger, or your app. For example, if you make changes and compile repeatedly WITHOUT running your app a few times, will the slowdown still accumulate? This would indicate the compiler is leaking something. On the other hand, if you compile and run the release version repeatedly and get the slowdown, that would exonerate the debugger. Also, when your app runs slower, do other things on the computer also run slower? (You could keep a stable copy of your game around and try it after you've seen the recompiled version seems to get slower.)

Good luck. My guess is that users will never see this problem, so annoying as it is, try not to spend too much time on it.

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Jesse
Unregistered
 
Post: #3
Thanks very much for the suggestions - I wouldn't have thought of some of those things. I'll look into it.

Any other suggestions are also welcome.

Thanks,

Jesse
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Upgrade to Mac OS X. No reason not to on that machine, and the whole developer experience is that much better.

OpenGL's memory management stuff is hugely dodgy under Mac OS 9, and that alone could probably cause the kinds of problems you've described...
Quote this message in a reply
Jesse
Unregistered
 
Post: #5
Thanks - it's interesting to know that there are issues with OpenGL in OS9.

Unfortunately some of the software I use in my profession (music) doesn't run in X yet, which is why I've been developing in 9. I do want the engine to eventually run in both 9 and X, so I'd like to get it working in 9 if possible.

If for no other reason than that Quake runs fine in 9.2.2, I assume it's possible to keep this from happening in 9. Maybe it's a Codewarrior thing.

In any case, it looks like I'll have to do some serious digging to find the cause. I'd be interested in knowing, though, a) if anyone else has encountered anything like this, and b) if anyone else is developing in 9 with Codewarrior and not having similar problems.

Thanks for the replies Smile

Jesse
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  iPhone 3GS OpenGL strange framerate bug airfire 2 3,410 Dec 2, 2009 09:22 AM
Last Post: airfire
  GLUT consistant framerate? JeroMiya 2 4,465 Apr 30, 2007 02:25 AM
Last Post: OneSadCookie
  SDL Framerate Control joellevin 10 8,316 Jan 4, 2007 01:26 PM
Last Post: arekkusu
  Weird problem in xcode SDL skrew 3 3,275 May 27, 2006 08:43 AM
Last Post: Greywhind
  Capping framerate unknown 18 7,639 Jul 19, 2005 04:57 AM
Last Post: unknown