Advantages of a 64 bit system
From a developer perspective i am trying to开发者_开发技巧 understand , what is the selling point of a 64-bit system ?
I understand that more registers are at your disposal , more memory can be allocated to a process , but i cannot understand what makes a developer's life easier. Any examples ?
From a performance perspective are there any gains seen if a program is run on a 32bit vs 64 bit ?
Cheers!
EDIT : Thank you for all your replies. I see some conversations shooting towards end user experience , important as it may be.. I am looking more at any architectural benefits that you can squeeze out.
From what i understand , it looks like the optimizations are a lot at the compiler-assembler chain rather than a functionality which a programmer can call on ?
When you have 64-bits of address space to play with, you can adopt certain designs that would be very hard with less of an address space. For example, a friend recently pointed out to me that address space for thread stacks can get to be a problem with thousands of threads on a 32-bit system. But on a 64-bit system, this is no longer even remotely close to being a problem. This is the main direct benefit to developers that can affect how you write programs. And this is true regardless of how much actual memory the machine has.
Most programs I have seen converted to 64-bit have seen performance improvements because of the extra registers available.
Having 64-bit addresses can offset this performance improvement in some programs. The extra space pointers take up mean they take more cache, which leaves less space in your cache for other things. Also they take up more memory bus bandwidth when being transferred to and from main memory.
There is at least one project out there that proposes to recompile most programs in Linux in a sort of mixed-mode in which all the extra registers are used, but only 32-bit pointers are used. I'm interested in how this pans out because it removes the one performance disadvantage of 64-bit programs.
There is also a small (but important) subset of programs and algorithms that can make use of 64-bit registers. For example, most of the SHA-3 candidates are designed to take advantage of the ability to manipulate 64-bits of data at a time when doing bitwise operations.
Lastly, since the data paths inside the CPU are now 64-bits wide, this can also mean there is more bandwidth inside the CPU for moving things around. But I would expect this to be a benefit on 64-bit CPUs running in 32-bit mode as well.
When you run multiple processes e.g. debug session, compiler and other tools you will notice a big performance gain if you have lots of RAM in your system. I have 16GB RAM in my Win7 system and I will never go back to having less. Its a bit like when you start using dual monitors, one just isn't enough after that.
As you said, more memory can be a big advantage. For 32bit systems you'll be limited to processes max 4GB (or even 2 or 3, depending how annoying your OS is).
64bits is double the amount of bytes per instruction, so you have more bandwith internally. eg: faster everything.
see also: http://lifehacker.com/5431284/the-lifehacker-guide-to-64+bit-vs-32+bit-operating-systems
A few Mac OS X specific answers (general ones are covered in other replies):
1) In 32 bit OSX, address space is mapped 4/4 (i.e. kernel gets the full 2^32 AND each app does), which requires flushing the TLB twice on each syscall. In 64 bit there's plenty of room to map the kernel and the application into different address ranges.
2) Objective-C programs use the new ABI/runtime on 64 bit x86 machines. This gets you C++ compatible exceptions, non-fragile instance variables, and some speedups.
Most desktop apps actually don't need to be 64 bits binaries, to the notable exception of image or video processing apps. In contrast, server apps often do.
The best advantage of running on a 64Bits machine a is that your app will have more RAM space, so it won't get swapped away when other apps will need the RAM. Yet 32 bit apps run on 64bits machine (luckily enough). I'm typing this on a 16GB Linux laptop with 2 DB (Oracle 11g and Mysql 6.0alpha), Windows in VirtualBox and a host of Java VMs, eclipse with Xmx=2GB...) and I couldn't cram all this on 4GB. Yet I still prefer to run 32bits apps when they do not need large amount of memory space.
Sorry, I kept this a bit list style, and avoided not mentioning increased memory addressing and more which had already been mentioned.
a) You'll have double the amount of registers, actually giving you three times the amount of registers at you disposal. b) General purpose registers are increased from 32 to 64 bit, meaning processing of 64 bit integers (i.e.) will be faster. c) More efficient position independent code since data can now be referenced relative to the RIP register. d) No-execute bit making the system more tolerant towards buffer overflows.
A 64-bit system has 64-bit memory addresses instead of 32-bit addresses, and so the maximum amount of memory available is 264 vs 232. This first quantity is roughly 1018 bytes, compared to the 109 bytes you can have with the latter quantity. Consequently, it's possible to have a lot more memory in a 64-bit system.
精彩评论