Porting 32 bit C++ code to 64 bit - is it worth it? Why?

前端 未结 19 2828
攒了一身酷
攒了一身酷 2020-12-24 00:58

I am aware of some the obvious gains of the x64 architecture (higher addressable RAM addresses, etc)... but:

  • What if my program has no real need to run in nati
19条回答
  •  粉色の甜心
    2020-12-24 01:53

    Some OSs or configurations are unable to run 32-bit programs. A minimal Linux without 32-bit libc installed for example. Also IIRC I usually compile out the 32-bit support from the kernel.

    If these OSs or configurations are part of your potential user base then yes, you should port it.

    If you need more speed, then you should also port it (as others have said, x86-64 has more registers and cool instructions that speed it up).

    Or, of course, if you want to mmap() or otherwise map a large file or lots of memory. Then 64-bit helps.

提交回复
热议问题