For example, on my Mac Mini with Bootcamp, Team Fortress 2 runs at about 20fps in OSX and 80fps in Windows. This seems to be a common case. Why is this?
|
|
Direct3D drivers on Windows are ridiculously optimized, sometimes for specific games, and developed by individual hardware vendors. Apple's OpenGL drivers are written and maintained (AFAIK) by Apple, and are intended for "general" OS use, compositing the UI and whatnot. There's no so much optimization for gaming and high-performance throughput. Basically, a lot of resources from a lot of sources have gone into making DirectX fast on Windows, while much fewer resources are available to do the same on Mac. |
|||||||||||
|
|
While I won't discount the optimization that Microsoft may have put into Windows and/or DirectX, I strongly believe that most programs perform better on Windows simply because that's what the developers focus on (that's where the money is). They make design decisions with Windows in mind, and then later try to make it work in other OSs (Mac, Linux, etc.). I constantly run into this at work: other projects have so much trouble with porting to non-Windows systems because the developers treated it as an after-thought. I have repeatedly written programs that build on multiple OSs with very little effort because I planned it that way from the beginning. Once you've really tried to do it (as opposed to grudgingly doing the port after-the-fact), you learn what it takes and it requires very little extra effort. Most of the performance differences are caused by design decisions made at the beginning of the project. |
|||||||||||
|
|
As a fellow Mac user, I'd like to offer an additional factor: the CPU scheduler in OS X is more "fair" than in Windows. This is sort of a complicated computer science topic, so here's a simple way to think of your CPU scheduler: your processor has to juggle many tasks at once (all your open programs, plus background system processes). It can only actually do a couple things at once (the number of cores times the number of threads per core; a dual-core i7 can do 4 tasks at once, for example). So it splits all the work into pieces, and alternates between them so that it looks like it's actually doing a lot of things at once. When you run two programs, the processor is actually just alternating back and forth between processing those two programs, really fast (like, a few microseconds here, and then a few microseconds there). The pattern for which things are executed in what order and for how long is decided by a "scheduling algorithm". For example, the round robin scheduler just arranges the tasks in a circle and processes each one in order. Another scheduler might arrange the tasks from least-to-most time remaining - small tasks would be done quickly, and big tasks might have to wait a while before being done. Windows and OS X are very different, and their scheduling algorithms are a bit different as well. Windows is a little "smarter" about prioritizing things, so it gives extra priority to visible programs in order to make the computer appear faster. OS X, however, is more fair to background processes. The overall algorithms are much the same between the two OSes (they are both multilevel feedback queues), but this little detail results in a different user experience. Both sides have their advantages. Like I said, visible programs in Windows will appear faster because they get more priority; but if one visible program decides to take a lot of power, the whole computer suffers a bit more. OS X's more fair scheduler results in more predictable and stable speeds, which is good for audio and video operations. For example if you're playing a song in the background, it's less likely to stutter when you do other things at the same time than in Windows. So, the takeaway point is this: a full-screen game in Windows is going to get high priority on the CPU and anything running in the background will just have to wait. In OS X, this is less the case. Some technical info about the schedulers is given here; the rest of this answer is from my computer science education and my usage of OS X over the past 10 months, after having used Windows for over 10 years (and Linux occasionally). I am sometimes frustrated by the more fair scheduler, but other times I appreciate its advantages. Linux, by the way, has an even more fair scheduler implementation; this is what makes it a great server, but in my opinion the user experience is degraded. For example, when your computer is bogged down with tasks, your cursor will stop responding smoothly because it's given the same priority as everything else. This basically never happens in Windows or OS X. |
|||
|
|
|
i think Fortress is like most of the mac games not native written for the mac. It's the "normal" windows game but with an integrated -i will call it- emulator. Thats why it's so much slower. |
|||||||||||||||||
|