Jump to content
IGNORED

Weird Stella performance issues (Mac OS X)


Room 34

Recommended Posts

I'm trying out the latest version of Stella for Mac OS X on my aging iBook (500 MHz G3), and I've noticed some strange performance issues.

 

First off, older versions of Stella would never run at an even close to acceptable speed on the iBook except at single-pixel resolution. (I could never figure out why simply doubling the pixels would slow it down so dramatically, but there it is.)

 

I recently downloaded a newer version (1.4b1) and was delighted upon trying a few games to see that it seems to run great at double and even triple size on my iBook! But tonight, an unpleasant discovery... not all games are created equal.

 

I fired up Yars' Revenge and was surprised to see how slowly it ran (even at the single-pixel size). Then, just for comparison (since that's the only reason I'd play it) I started up Pac-Man. Ran perfectly. So I tried another test, and this is what really struck me: Jr. Pac-Man. The game runs full-speed (if not TOO fast) when you're moving side to side, but as soon as the maze scrolls, it slows WAY down.

 

Anyone have an explanation for why this is happening? (And what's so different between Pac-Man and Yars' Revenge to explain their huge speed discrepancy?)

 

Thanks...

Link to comment
Share on other sites

I recently downloaded a newer version (1.4b1) and was delighted upon trying a few games to see that it seems to run great at double and even triple size on my iBook!

 

Good to see that the newer versions are faster than the older ones. It doesn't always happen that later versions of a program are faster than earlier versions ...

 

But tonight, an unpleasant discovery... not all games are created equal.

 

Oops :(

 

I fired up Yars' Revenge and was surprised to see how slowly it ran (even at the single-pixel size). Then, just for comparison (since that's the only reason I'd play it) I started up Pac-Man. Ran perfectly. So I tried another test, and this is what really struck me: Jr. Pac-Man. The game runs full-speed (if not TOO fast) when you're moving side to side, but as soon as the maze scrolls, it slows WAY down.

 

This problem is now well understood, but it wasn't when I wrote the timing code a few months ago. Basically, it takes differing amounts of time to draw different frames (as you're seeing), since some frames have more movement than others.

 

Now, the current timing code just pumps out frames at 60 fps. But, if the current frame takes longer than 1/60 of a second, the next frame will be played at 1/60 s - the amount the other frame went over 1/60 s (confused yet?) :)

 

Basically, there's no frameskip in the code. It always wants to run the system at 60 fps, and that may result in slowdowns (and later speedups) if the 1/60 second limit can't be reached. The ideal solution would involve dropping frames if they can't be done in time.

 

The reason I never noticed this before is that in all honesty, the slowest machine I could fine to test on was a 1GHz Athlon (I don't have access to Macs at all), and the problem never occurred.

 

My only suggestion at this point is to try the OpenGL mode. It should make use of hardware scaling, so the window being rendered is always only 300x200 pixels. And, it doesn't make use of dirty rectangles like software mode, so each frame should take the same amount of time to render.

 

Other than that, you'll have to wait until the next release, where I hope to fix these issues for good.

 

Anyone have an explanation for why this is happening? (And what's so different between Pac-Man and Yars' Revenge to explain their huge speed discrepancy?)

 

Hopefully this was explained above (if everyone is still awake at this point :))

 

Steve

Link to comment
Share on other sites

My only suggestion at this point is to try the OpenGL mode.

Thanks for all of the useful info. I decided to comment on this point because it may be of use to you: On my iBook, at least, OpenGL is IMMENSELY SLOWER than software rendering. Granted, the iBook has a very weak video card (not sure exactly what it is, but I know they've goosed them considerably since my aging iBook was made).

 

No one should spend much time trying to make Stella run better on my now-ancient iBook... I just can't afford to get a new one right now! :(

Link to comment
Share on other sites

Well, I do know that I used an earlier version of MacStella and it played Solaris SLOW. The last version of MacStella I got Solaris worked fine. I remember reading somewhere that OpenGL in Panther is better than it is in Jaguar. MAYBE that's what's causing the speed problems. It might far fetched but it's just an idea.

Link to comment
Share on other sites

With some games, Stella OS X runs very slowly for me as well, and this is on a 2Ghz G5.  I'm willing to help test any new versions that come down the pike, especially if optmizations are made with regards to the OS X version. :)

 

..Al

 

Well, I just recently fixed a problem in Windows where the software mode was using DirectX. Since SDL wasn't optimized for this, the rendering was slow on a 3GHz machine. I just added the option to use the 'windib' backend, and now it flies in software mode, just like in Linux. Maximum FPS increased from 60-70 fps to almost 900 fps!

 

I'm willing to bet that there's a similar problem in SDL for OSX. That is, the SDL OSX backend itself isn't as optimized as it could be.

 

I really need to get an OSX machine and test other SDL emulators under it, as this may well be an SDL issue. Its support for OSX is still very preliminary.

 

Steve

Link to comment
Share on other sites

My only suggestion at this point is to try the OpenGL mode.

Thanks for all of the useful info. I decided to comment on this point because it may be of use to you: On my iBook, at least, OpenGL is IMMENSELY SLOWER than software rendering. Granted, the iBook has a very weak video card (not sure exactly what it is, but I know they've goosed them considerably since my aging iBook was made).

 

I'm willing to bet that either OpenGL isn't accelerated at all, or the video card is so old that it just can't handle OpenGL that well.

 

No one should spend much time trying to make Stella run better on my now-ancient iBook... I just can't afford to get a new one right now! :(

 

I think that in the future, we may have to make a G4 be the minimum required. If I ever get a Mac, that's probably what I'll be going for (a G4 Powerbook).

 

But, there may be some light at the end of the tunnel. Stella in Linux just flies; I can get in excess of 1000 fps in software mode and about 700 fps in OpenGL mode. So the code can perform ...

 

Previously, Windows had a similar problem in software mode. In software mode, I could barely get 60 fps on a 3GHz machine. Once I switched to a different backend, the fps increased to at least 700.

 

So, when/if I fix the issue in OSX, I expect similar speed increases. But I still don't know if a G3 will cut it.

 

Of course, this all depends on me getting a Powerbook. I'm feeling the pull ... :)

 

Steve

Link to comment
Share on other sites

I am running Stella for Mac on a iMac with a 500 MHz G3. Software mode is definitely faster than OpenGL mode. It seems odd because If a play a game like Quake II or Unreal, the Open GL mode kicks the crap out of software mode.

 

Not surprisingly I see a considerable speed boost if I run in full screen mode over windowed mode.

 

If there is a need for any OS-X programmers to help boost Stella's speed on OS-X, I would be happy to help. :)

Link to comment
Share on other sites

I am running Stella for Mac on a iMac with a 500 MHz G3.   Software mode is definitely faster than OpenGL mode.

 

Software mode makes use of dirty updates. That is, only the parts of the screen that have changes are updated. OpenGL mode just updates the whole thing, since the framebuffer is only ever 300x200 pixels. For larger zoomed modes, it just uses the OpenGL hardware to zoom (ie, no more pixels are rendered).

 

It seems odd because If a play a game like Quake II or Unreal, the Open GL mode kicks the crap out of software mode.

 

Now this is where I'm confused. So, you are saying that you have a system that can handle Quake 2 in OpenGL, but that same system can't do Stella in OpenGL? If so, that's extremely odd. Stella makes extensive use of glTexSubImage, which is known to be slow in some OpenGL implementations. But I wouldn't think that Quake 2 could outperform Stella :(

 

Not surprisingly I see a considerable speed boost if I run in full screen mode over windowed mode.

 

How much, exactly? You see, in Linux, windowed and fullscreen modes are essentially the same, and in any event I can get almost 600 fps in OpenGL. So, I've never had the opportunity to test for a system where windowed mode is so much different that fullscreen mode.

 

If there is a need for any OS-X programmers to help boost Stella's speed on OS-X, I would be happy to help.   :)

 

Have you programmed in SDL in an OSX environment before? At this point, I need to do a profile to see exactly where the slowdown is occurring. But that's kind of difficult when you don't have an OSX machine. Maybe I could get someone to donate an older one to me? :)

 

Steve

Link to comment
Share on other sites

With some games, Stella OS X runs very slowly for me as well, and this is on a 2Ghz G5.  I'm willing to help test any new versions that come down the pike, especially if optmizations are made with regards to the OS X version. :)

 

..Al

 

Al, could you provide more information? Specifically, what games are running slowly? Are you using fullscreen or windowed mode? Are you using software or OpenGL rendering? What type of video card, amount of RAM, etc?

 

Basically, any info you could provide would be helpful.

 

I've just read on the SDL mailing list that software SDL under OSX is indeed quite slow. Someone just posted a patch that reportedly makes a test program go from (and I quote) "a consistent 25-27 to 150-300." And with other modifications, "it went up to over 4500. Not a typo." :)

 

Feel free to move this to personal email if you want. And any other OSX users, please send me whatever information you can.

 

Steve

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...