Tuesday, August 05, 2008

When I'm 64...

We get a number of questions about whether X-Plane takes advantage of 64-bit CPUs.  The short answer is: "no, not yet", but here's the details.

Some of the people who ask are Linux users who haven't been able to set up 32-bit compatibility libraries for their 64-bit Linux distribution.  To me, this is a portability request, e.g. can you make X-Plane work on yet another operating system.  I don't view this as a high priority because you can run X-Plane on a 64-bit operating system using 32-bit compatibility libraries for a number of distros.  Linux comes in a million flavors and we can't support them all.

Other users ask about 64-bit because they have 64-bit CPUs (and possibly paid more for a 64-bit operating system) and want to know when they get some benefit for their money.  But...is 64-bits actually useful?

A 64-bit CPU is one that can deal with larger integral numbers - as a result it can access more memory than 4 GB, and it can do math with very large integer numbers more efficiently.  64-bit CPUs also have some architectural differences that are theoretically beneficial.

Is It Faster?

Joshua tried building an experimental 64-bit version of X-Plane for Linux when he first got his 64-bit AMD box and he found...

...no performance benefit at all.

Doh!  This actually isn't surprising.
  • X-Plane doesn't use very large integral number math.  X-Plane uses a lot of floating point math.
  • The biggest time-sinks for the CPU in X-Plane are talking to the driver and sorting through piles of scenery.  The later task requires a lot of logic and memory access -- neither of which work any better on a 64-bit CPU.
So the short answer is: you're not going to get a fps boost from 64 bit.  Sorry.

Memory, Memory, Memory

Now 64-bits is useful because a 64-bit app (on a 64-bit OS and 64-bit CPU) can access more than 3 GB of RAM.  We're reaching the point where a lot of users have 4 GB of RAM and a machine that could be using all of it.  While I've been dragging my feat on the move, someday we will support 64-bits and X-Plane will be able to use more memory.

But in the meantime, I've been doing everything I can to reduce the amount of memory X-Plane uses.  This is because optimizing memory usage benefits all users, while 64-bits only helps users with a 64-bit OS and a 64-bit CPU.

I believe that we'll reach a point where 64-bits is useful for users who want to use a ton of add-ons simultaneously.  But the out-of-box X-Plane configuration needs to work with much less memory than 4 GB.

4 comments:

Anonymous said...

Great to hear ben!! My 8 gb x-plane computer is eagerly waiting to show its full potential. Thanks again!

Anonymous said...

"Now 64-bits is useful because a 64-bit app (on a 64-bit OS and 64-bit CPU) can access more than 3 GB of RAM."

Actually, a 32-bit app can access 4 GB of virtual memory on 64-bit MS-Windows. The OS executes in 64-bit address space and allocates 4 GB of VM to each 32-bit process.

Benjamin Supnik said...

Good point - the limit will vary between 2 and 4 GB depending on the details of the OS, the hw, and various config options. 3 GB seems to be the most common config we see these days (Win XP, Mac OS X 10.4/10.5, and various 32-bit Linux distros).

Anonymous said...

Just bought the full version....

My two best machines (AMD Phenom 2 with 4G and Core i7 with 12G, Sapphire HD4870x2 - the latter I REALLY hoped to run X-plane on) are both 64 bit. Do you really need everything in http://packages.ubuntu.com/dapper/i386/libs/ to get it working under Ubuntu 8.10? There are hundreds of files to download and unpack, is there a script somewhere to do the unpack install automagically? I don't have time to manually unpack and move hundreds of .so files.

In the meantime, I anxiously await for you to make the jump to 64 bits. It would probably make your life a lot easier w.r.t. memory management. When you get there, I know a LOT of people I work with who would be your first customers. I would love to make my friends with Flight SimX and Windows green with envy... :)

Having it play nice with Compiz would be a 2ndary nice to have....