Advantages of a 64 bit system

2019-02-07 06:09发布

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 ?

7条回答
We Are One
2楼-- · 2019-02-07 06:36

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.

查看更多
干净又极端
3楼-- · 2019-02-07 06:37

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.

查看更多
孤傲高冷的网名
4楼-- · 2019-02-07 06:42

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.

查看更多
爷的心禁止访问
5楼-- · 2019-02-07 06:44

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.

查看更多
Lonely孤独者°
6楼-- · 2019-02-07 06:44

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.

查看更多
beautiful°
7楼-- · 2019-02-07 06:46

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

查看更多
登录 后发表回答