Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do 32bit apps run faster or slower on a 64bit OS? [closed]

I've mostly worked on 32bit embedded systems where it was generally faster to use native 32bit types (int, float) than the 16bit equivalents. The slowdown came from the processors expanding any 16bit number to 32bit before performing operations on it.

Now I've moved to PC's and the 64bit OS. My question is - do 32bit types cause any slowdown on 64bit machines?

For example if I build MyApp.exe as a 32 bit application, will it run slower on a 64bit OS or faster?

I understand that there are many factors involved in performance of an app and I'm deliberately excluding those factors from the question (IO speed, faster memory etc).

like image 210
Chris Masterton Avatar asked Sep 01 '12 04:09

Chris Masterton


People also ask

Does 32-bit run faster than 64-bit?

Simply put, a 64-bit processor is more capable than a 32-bit processor because it can handle more data at once. A 64-bit processor can store more computational values, including memory addresses, which means it can access over 4 billion times the physical memory of a 32-bit processor.

What happens if you run a 32bit program on a 64-bit system?

To put it in simple words, if you run a 32-bit program on a 64-bit machine, it will work fine, and you won't encounter any problems. Backward compatibility is an important part when it comes to computer technology. Therefore, 64 bit systems can support and run 32-bit applications.

Are 64bit apps faster?

The difference in performance between 32-bit and 64-bit versions of applications depends greatly upon their types, and the data types they are processing. But in general you may expect a 2-20% performance gain from mere recompilation of a program - this is explained by architectural changes in 64-bit processors [1].

Is Windows 32-bit slower than 64-bit?

No, and it will run faster than an Windows x64 bit OS. Mostly all CPUs released in the past few years are 64 bit, but have the ability to run 32 bit code.


1 Answers

Sometimes 32-bit applications run faster, sometimes they run slower. There are a lot of competing factors affecting the performance. Generally the difference in either direction isn't very large.

I don't see how you can legitimately exclude any factor from performance considerations, because performance always happens in the real world where all factors are in play. Speed is not theoretical and cannot be treated in isolation.

Here is an article where the author did some benchmarking:

http://www.osnews.com/story/5768

He found that the 32-bit binaries were faster in his tests. That was on SPARC in early 2004.

Here is a 2010 article from Intel about moving to 64-bit applications:

http://software.intel.com/en-us/articles/moving-from-32-bit-applications-to-64-bit-applications-en/

According to this article, 64-bit binaries can giver you faster math, so math-heavy code should be faster if correctly optimized. Otherwise, your 64-bit code may well be slower, particular since it takes more memory and this may result in more time spent accessing RAM (more frequent cache misses).

like image 77
Nate C-K Avatar answered Sep 23 '22 07:09

Nate C-K