15

I just noticed that by instance famous application like chrome didn't have any 64 versions at least under windows.

In my firm I write applications which run under 64 bits version of windows in 32 bits mode.

I am wondering if I could have some advantages/performance gain to build applications in 64 bits mode rather than in 32 bits

Edit :

Typically, in which kind of software, the increase of registers number will be benefict ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Guillaume Paris
  • 10,303
  • 14
  • 70
  • 145
  • 2
    The 64-bit version of Windows comes with Internet Explorer in both 32-bit and 64-bit variants, but the 32-bit one is the default because a lot of IE plugins are 32-bit only and won't load in a 64-bit process space. Chrome is 32-bits probably for the same reason. – In silico Jan 08 '12 at 11:05
  • possible duplicate of [64-bit Performance Advantages](http://stackoverflow.com/questions/3343812/64-bit-performance-advantages), [What are the lower level advantages and disadvantages of 64-bit/32-bit?](http://stackoverflow.com/questions/1282206/what-are-the-lower-level-advantages-and-disadvantages-of-64-bit-32-bit) – Cody Gray - on strike Jan 08 '12 at 12:02
  • If you've got a 32-bit code base, start working your way up to 64-bit. There will be big benefit to some existing data processing, but lesser so to the processor-related internals, as the coordination/logic itself will nearly double in size and somewhat smooth out the supposed performance gain. But it's important enough to get rid of the compatibility layer. – ActiveTrayPrntrTagDataStrDrvr Nov 20 '12 at 12:16

3 Answers3

8

64 (x86_64) bits is mainstream now. 2 big advantages here:

  • Available more memory without any tricks
  • More general-purpose and additional processor registers

But you have small disadvatage too:

  • More memory consumption (usually like 20-30% bigger than 32 bit)

I think Google Chrome runs in 32 bit mode in Windows because there are too much 32 bit plugins (like Flash). Also there is linux version for 64 bit.

Edit for additional question

Typically you will get benefits if your application uses math (64-bit integer arithmetic), coding/encoding/packing/unpacking, cryptography.

Also look at IBM 64-Bit Computing Decision-Maker’s Guide http://www.onitecservice.com.br/produtos/arquiv_pdf/nocona64bit_onitec_service.pdf

What types of applications will and won’t take advantage of the switch from 32-bit to 64-bit computing?

In order from greatest to least benefit, the types are:

  • I/O intensive — Any application that spends more time fetching data from devices than processing it: database back-end, e-commerce, CRM, ERP, SAP, SAS, various business-critical and vertical applications, and any other application that has large memory requirements. In general these applications should see significant performance improvements from 64-bit hardware, operating systems and device drivers, as well as the elimination of memory overlays and other performance inhibitors.
  • Compute-intensive — High Performance Computing (HPC) and scientific/technical computing, including life sciences, geophysical research; high-end graphics rendering; streaming video, and any other application that spends more of its time processing data than retrieving it.
  • Gateway/security infrastructure — SSL servers, directory services, Internet caching and database front-ends. These applications may obtain benefit from the switch. You should contact the individual software vendors to find out their plans for exploiting 64-bit features.
  • Standard infrastructure — This class generally will see little benefit from 64-bit computing. Applications include file and print servers, low-volume/noncritical business applications, and legacy applications that are unlikely to be rewritten for 64 bits.
abdolence
  • 2,369
  • 1
  • 21
  • 29
  • 20-30% seems huge and is hard to believe for the average. Do you have some source for that? – bames53 Jan 08 '12 at 11:09
  • 1
    Even if the 20-30% figure is true, 64-bit machines usually come with way more memory than a 32-bit machine. After all, the whole reason of having 64-bit processors is so that you can address more than 4 GB of RAM. People building 64-bit machines with only 4 GB of RAM are completely missing the point. – In silico Jan 08 '12 at 11:11
  • 1
    @bames53: Considering that pointers will, in general, even, be twice the size in a 64-bit application versus a 32-bit application, this is fairly believable, though I've never checked myself. – Zéychin Jan 08 '12 at 11:12
  • @bames53 No - I don't have good public link. I think you can google it also. This is our internal experience where we migrated from 32 bit to 64 bits some times ago (we have C++ and Java server applications). Of course it depends to your application, but sometimes we got increasing memory consumption up to 40%. – abdolence Jan 08 '12 at 11:22
  • @Zéychin Well, to get a 30% slowdown due to pointers doubling in size, in in a program that's just copying data around, you'd need 30% of the data to be pointers in the 32 bit version, and ~46% percent of the data in the 64bit version. That seems really, really high. – bames53 Jan 08 '12 at 11:22
  • 1
    @bames53: Pardon me. I did not mean for you to think that **only** pointers will increase in size. Some other types **can** also increase in size. Besides, I think you have a fundamental misunderstanding here. 20-30% increased memory usage does **not** imply that there is a 20-30% **slowdown** at all! – Zéychin Jan 08 '12 at 11:26
  • @Zéychin Referring to a slowdown was just a mistake on my part, I should only have referred to increased memory usage. Also, while pointers aren't the only thing that increase in size, at least with LLP64 systems like Windows I would guess that pointers comprise the vast majority of the data that doubles in size. On LP64 systems like most (all?) unixes there's probably a fair bit of other data that doubles in size. – bames53 Jan 08 '12 at 11:39
0

If you have the possibility to compile for a 64-bit target you should do it (imho). You could try and analyze your application to see if there is an actual need (memory consumption limites etc.) - but I for one like to see the "64-bit" marker in my application management tool when I scroll over running processes.

There are several advantages of 64-bit mode applications the main reason being more available memory. If your compiler handle the compilation properly and optimize the code accordingly you should be able to get some extra performance.

Try and do a "real world" test - compile in both 64- and 32-bit, and draw up some performance charts. I did this on the an application and it showed a ~20% performance boost (faster calculation) and the amount of data the program could load suddenly seemed "infinite".

(My best guess about Chrome is that they are relying on some 3rd party library running in 32-bit only or maybe using some 32-bit only Windows API.)

Michael Banzon
  • 4,879
  • 1
  • 26
  • 28
  • how does this answer the question, which is *I am wondering if I could have some advantages/performance gain to build applications in 64 bits mode*? – just somebody Jan 08 '12 at 11:07
  • I have to agree with just somebody -- you didn't reference any advantages, you just said that one should compile to 64-bit without any guidelines or justification. – Zéychin Jan 08 '12 at 11:14
  • @justsomebody - you're right - I mainly focused on the "why isn't Chrome running 64-bit"-part. Edited to answer the real question better. – Michael Banzon Jan 08 '12 at 11:15
0

Shamlessly just scanned http://en.wikipedia.org/wiki/64-bit There are pros and cons, for detailed info, look at that wikipedia page. As outlined there there main advantage to 64-bit versions of your application is the ability to access more registers in the x86-64 architecture.

Give that page as well, there is no indication that there are any significant performance gains out of the box. You would have to tune your application to make use of the features it provides, i.e. more registers and more memory since the same data occupies more space in memory (due to longer pointers and possibly other types, and alignment padding).

According to W/P the more memory usage is probably the main disadvantage as well. In short, performance gain may be there to be had but your program would need to change somewhat to take advantage of it. I'd suggest benchmarking your program on both architectures to see if it makes an immediate difference (without changing anything possibly).

zcourts
  • 4,863
  • 6
  • 49
  • 74