Cross-Platform Performance Differences

I’m working on a (rather large) project which uses OpenGL across three different platforms (OSX, Windows, and Linux). I recently ported the newest version (which I had been working on on OSX) over to Linux and Windows. It was a relatively seamless port, as people on this project have been doing it for a couple of years.

When I ported the program to Linux, I noticed a rather large difference in rendering times, favoring Linux (3D rendering, real-time rotation, zoom, translation… you know the deal). I figured it was just Linux, and I was rather impressed with it. However, I then ported it over to Windows, and the same thing happened… a large jump in performance, in the favor of Windows. This is when I decided it was a little suspicious.

I’ve checked throught optimization settings on the compiler. I’ve even tried using a Unix makefile (almost exactly the same as the one used on the Linux machine) on the Mac, as opposed to XCode, which I had been previously using (and will continue to use). I’ve looked through Apple’s Developer website, and I found it all but un-navigable (or I’m just looking in the wrong places… that’s possible). The Apple I’m working on is a G5… the Linux machine is a stock Dell (not new), as is the Windows machine (I think… not too sure on that one).

So, is there any reason you can think of that there should be a large gap in performance, especially between a G5, and two inferior machines? Any ideas would be helpful. Thank you for your time.

P.S. - Note that I’m not exactly skilled in the ways of XCode… I don’t know much about it at all.

There are any number of things it could be… There are a bunch of things that are very slow on the Mac (immediate mode being the worst culprit), and a bunch of things that are very fast compared to the PC world (display lists, ReadPixels). Also, GCC is a much better compiler for x86 than for PowerPC.

There are other things that can hit you without being obvious, for example Qt likes to inset the window’s grow box over the top of the GL context, which is very slow, and QGLWidget resizes the context (to the same size) every frame which is a lot slower on the Mac than on Linux.

Bottom line – profile your code (use Sampler and/or Shark) to find out why it’s slow. Probably it’s an easy enough change to the source code to speed it up.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.