32-bit vs 64-bit for C++ project

By leoalvesmachado
May 24, 2010
  1. Hi folks

    I'm developing a project in C++ and I want to get the best performance possible. My software code should be platform independent, so I can run it in any OS. My knowledge about hardware is almost "null", so I came here to ask a newbie question :)
    Today, I am compiling the project only for 32 bit machines, forcing the OS of 64 bit machines to translate the compiled instructions.

    My question is: This approach I've chosen (compile only in 32 bit) impacts the performance negatively if I run it in a 64 bit machine? Is so, would it be slower than a 32 bit machine (completely equivalent machine, but 32 bit), or it would have the same speed?

    Thanks in advance for your attention
  2. captaincranky

    captaincranky TechSpot Addict Posts: 11,462   +1,760

    I really know almost nothing about this, so fools rush in. A 64 bit computer is a 32 bit computer until something tells it it isn't. So, many programs are 32 bit and a 64 bit deals with them as such. To the best of my very limited knowledge, you don't actually have to "force" a 64 bit machine to deal with 32 bit software, it does that natively.

    As to speed of execution a 32 bit program would have slower execution speed than a 64 bit, all other things being equal.

    With that said, probably a more important consideration is to write code that is capable of taking full advantage of the current crop of hyper threading and multi-core CPUs.

    I think that multi-threading in a 32 bit program, would likely exceed single thread performance @ 64 bit.
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...