Does 64bit GNU/Linux have better performance?

07
2014-07
  • jcubic

    I had 32bit Ubuntu (with Xfce) and now I switch to 64bit Xubuntu and I'm not sure but I think that 32bit had better performace, but just a feeling. I want to know which one 32 or 64 will give better performace.

    I'm don't ask about the kernel but the whole system.

    My Machine: Asus laptop k51e with 4GB Ram and AMD Sempron 2 GHz processor.

  • Answers
  • David Schwartz

    AMD crammed 64-bit support into the Sempron without a redesign. This necessarily entailed a lot of compromises as a design optimized for 64-bit operation would have a lot of fundamental differences at a very low level.

    As a result, 64-bit operations in 64-bit mode are about 35% slower on the Sempron than similar 32-bit operations in 32-bit mode. Of course if you would need two 32-bit operations instead of one 64-bit operation, that's still a win for 64-bit mode. But if you replace 64-bit operations with 32-bit operations, as the kernel does for pointers, you take that performance penalty.

    There are still a lot of benefits to 64-bit operation. 64-bit operations are significantly faster for those times when you need them. And you have twice as many general purpose registers.

    Unfortunately, 64-bit programs tend to require more memory bandwidth than 32-bit programs, and the Sempron has a memory controller with just a single channel. It relies on caches to hide this cost, but 64-bit programs move more data and so tend to have higher cache miss rates for the same cache size.

    So your results aren't really all that surprising.

  • Lưu Vĩnh Phúc

    Do a search and you'll find tons of benchmark out there. In general 64 bit OS will have better performance because they have a larger register number which reduce memory access, SSE2 by default and many other newer features. But very large programs may suffer from cache miss because larger pointer and some data size, although most variable type still have the same size as 32 bit version

  • davidgo

    You would typically expect the same or better performance (depending on the way the software is written and the compile option) from a 64 bit OS unless your system is very memory constrained - 64 bit computers may take up more memory when representing some values.

  • ysomane

    Space is performance.

    Little caches perform better than big ones, and more 32-bit entries will fit in a fixed-size cache than 64-bit ones.

    So, all other things being equal, 32-bit systems perform better than 64-bit ones.


  • Related Question

    64 bit - How do I know if my linux kernel is running in 32bit or 64bit?
  • Daniel Cukier

    When I do a cat in /proc/cpuinfo it shows a line with clflushsize : 64

    Does this mean my kernel is running in 64 bits?


  • Related Answers
  • Rich Bradshaw
    uname -a
    

    will tell you the kernel - the end bit tells you the architecture.

    Two examples:

    My mac:

    Darwin Mac.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
    

    My Dreamhost hosting:

    Linux ecco 2.6.24.5-serf-xeon-c6.1-grsec #1 SMP Tue Oct 7 06:18:04 PDT 2008 x86_64 GNU/Linux
    

    i386 = 32 bit

    x86_64 = 64 bit

  • spatz

    uname -m will give you the architecture you kernel is compiled for. If it prints i686 then your kernel is 32 bit, if x86_64 then it's 64 bit, assuming you have an Intel/AMD chip.

  • Aquarius Power

    I think the most precise way is

    getconf LONG_BIT
    

    here it exactly shows 64

    found on this tip

    getconf is from package libc-bin (on ubuntu)

  • a_m0d

    If you want to see only the platform that you are running on, you can use

    uname -i
    

    The full list of supported options for uname is

    $ uname --help
    Usage: uname [OPTION]...
    Print certain system information.  With no OPTION, same as -s.
    
      -a, --all                print all information, in the following order,
                                 except omit -p and -i if unknown:
      -s, --kernel-name        print the kernel name
      -n, --nodename           print the network node hostname
      -r, --kernel-release     print the kernel release
      -v, --kernel-version     print the kernel version
      -m, --machine            print the machine hardware name
      -p, --processor          print the processor type or "unknown"
      -i, --hardware-platform  print the hardware platform or "unknown"
      -o, --operating-system   print the operating system
          --help     display this help and exit
          --version  output version information and exit