Subversion, Windows, and 64-bit

Windows ConfusionThere’s a lot of confusion, these days, about “64-bit.” The confusion isn’t helped by the fact that the situation has been evolving rapidly for some time. In fact, if you search the web for helpful advice, you’ll find articles going back a decade or so, full of sage and once-timely advice whose value (and even truth) has long past. You’re likely to end up more confused than when you started!

Fortunately, the evolution seems to be just about settled down, to the point where I think we can make pronouncements about “now” that will still be reasonably valid for a while. Or, at any rate, I’m going to give it a try. But, just for the record … this post is being written on March 23, 2011. If you’re reading it at some significantly later date, it’s just possible things have changed. Sorry about that. The change is out of my control, but at least I’m giving you a very clear indication of the vintage of this information!

And, I’m going to discuss all this primarily in the context of Windows systems, because the confusion seems to be greatest there, a result of both technical and cultural factors. If your platform is not Windows, then most of what I say is still true, but you probably have fewer choices to make, and simpler guidance from your vendor.

The Basics

To begin with, a big part of the confusion is that this isn’t really a single question, but rather a group of related questions. Cutting to the chase, I’ll list the questions here, and give the answers too. After that, it’s all just background and explanation.

  1. Question: Do I need any sort of 64-bit-ness at all? Answer: maybe. (“Great, that helped — NOT!”  you cry.)
  2. Question: Do I need 64-bit hardware? If the answer above is “yes,” then “yes”. Else, “no.” (We’re not really making much progress here, I admit, but hang in with me.)
  3. Question: Do I need a 64-bit OS? Again, if any of the answers in item #1 is “yes”, then “yes” (and by the way make sure the hardware is 64-bit too, or the OS won’t run). Else, “no.” But here’s a useful bit of certainty: the most compelling and common reason for using a 64-bit OS is to handle more than 3GB of RAM. Another reason is, if some program you’re running must be 64-bit (see below), then so also must be the OS, and hence hardware. But this is pretty rare.
  4. Question: Do I need a 64-bit version of any particular program? Not necessarily, even if your OS and hardware are 64-bit. Ask whoever provides the program. But if a program doesn’t need 64-bit-ness, then its 32-bit version will run just fine in a 64-bit OS and hardware. You can freely mix 32-bit and 64-bit programs.
  5. Question: Do I need a 64-bit Subversion? Almost certainly, No.

Well, at least that last question was easy!

The Horse’s Mouth

Who’s the boss? If you’re running Windows, then Microsoft is the place to start. Their 32-bit and 64-bit Windows: frequently asked questions page says:

The benefits of using a 64-bit operating system are most apparent when you have a large amount of random access memory (RAM) installed on your computer, typically 4 GB of RAM or more. In such cases, because a 64-bit operating system can handle large amounts of memory more efficiently than a 32-bit operating system, a 64-bit system can be more responsive when running several programs at the same time and switching between them frequently.

That’s actually a pretty clear answer to one part of the conundrum: “when do you need a 64-bit OS?” Or maybe, not so clear: all it really does is transform the question about the OS to a question about how much RAM you need or have. But how do you know that? No help from Microsoft. And the quote above also sheds no light on the needs of individual programs.

So, we dig just a bit deeper:

Breaking it down

Hardware: The hardware isn’t really a decision: you decide based on other needs (see other bullets), and then use hardware that supports what you want. Fortunately, modern 64-bit hardware supports either 32-bit or 64-bit stuff, so it’s a safe choice, even if it’s not required. There have been 64-bit computers for decades, but they weren’t originally something that could go on your desktop, so ordinary users didn’t encounter them. The steady march of Moore’s Law, however, has brought it to the desktop (and even laptop) at last. In fact, as of the date of this post, the moment is fast approaching when you can’t actually buy anything that isn’t 64-bit, which is a big simplification in this discussion (thank you, Dr. Moore!).

There was a bit of a misstep in this history, a few years ago: some early 64-bit computers required you to rebuild everything as 64-bit versions. This turned out to be a lot of trouble, and quite undesirable given the amount of “maybe” and “probably” and “if” and “it depends” in the “Basics” decision list above. These architectures are now pretty much out of the picture, though, and modern 64-bit architectures can run a mix of 32-bit and 64-bit stuff, all at once.

There is, however, one lingering compatibility trick, here, and I’m going to predict that this one does not go away in the future: any one program has to be all 32-bit or all 64-bit. You can’t mix the two in a single program. And for these purposes, the operating system, including all drivers and add-on stuff like that, counts as “a program.” This will come up again.

Operating System: The most compelling reason to go down the 64-bit road is to get an operating system that runs 64-bit. This is practically mandatory if you have some need for more than 3GB of RAM. And although it’s rumored that someone once said “no one will ever need more than 640K,” modern systems often push the 3GB barrier, and are virtually certain only to grow. So, you probably need a 64-bit OS, and it gets more likely every day, even for a desktop, laptop, or home computer. And that would mean you certainly need 64-bit hardware.

But fortunately:

Programs: Mostly, not. Even if you have a 64-bit OS, even if you have enough big programs to add up to many GB, each individual program would not need to be 64-bit. The 64-bit operating system carves out a comfy 32-bit space for each, and the programs all are free from 64-bit cares. If a single program itself needs more than 3GB of RAM, then that would make a 64-bit version attractive. But not necessarily: the obvious behemoths, like database engines and the Java VM, ran into these limits long before 64-bit hardware was widely available, and found various ways around the limits. Upgrading these to a 64-bit version is possible, and may show some performance gain, but it’ll be pretty small for most “general’ users.

The 64-bit hardware also includes some other improvements (such as more and wider registers), which mean that some smaller programs get a boost, too. But again, in most cases, it’s at best small. And it might be too small to measure: if a program spends most of its time waiting for the network, or waiting for the disk, then the extra registers are all waiting, too: no real gain.

The most common kind of  application that really does need a 64-bit version turns out to be anti-viral systems. These must follow the operating system: 64-bit for a 64-bit OS. The reason is that a significant amount of their value is actually packaged as a “driver,” which is an extension to the OS, and gets installed into and loaded with the OS. Remember that “each program, all or nothing” rule? Anti-viral drivers are actually part of the OS, and must “all or nothing” along with the OS.

The same goes for the drivers that connect you to printers, cameras, add-on disks, and so on. If your OS is 64-bit, your drivers must be, too.

Subversion: So what about Subversion?

  • Is it a program? Yes, of course. So that puts it into the “mostly, not” category.
  • Does it include a driver? No. So we’re not sucked in with the driver crowd.
  • Does it, itself, need more than 2GB? No. Even when your repositories, working copies, or even single files are much larger than this, Subversion only holds a smaller portion in memory at any one time (we say it “streams” the data). So there’s no need for a large address space.
  • Does it have tight compute loops that would benefit from the extra registers and such? No, not much. Most of Subversion’s time is taken up waiting for the network, or waiting for the disk.

So a 32-bit Subversion is enough, and it will run (even in a 64-bit system), and although it’s possible to build a 64-bit Subversion, it doesn’t actually provide any benefits.

Exceptions: If

  • You have some program that actually needs to be 64-bit, and
  • Your program needs to link to the Subversion libraries
  • Then, you’ll need 64-bit Subversion libraries (once again: all or nothing).

Similarly, if

  • Your program uses an installer
  • That’s able to install 64-bit stuff
  • Then it can’t install 32-bit stuff
  • So you may be forced into 64-bitness just for installer compatibility (the “all or nothing” rule applies at the installer point)

For example, the popular TortoiseSVN client provides separate 32-bit and 64-bit downloads of TortoiseSVN, for reasons such as these.

Photo credit: Kristian D.

[Update: Boy, there’s a classic: I typoed the date in that “tell you the vintage” paragraph! Fixed it.]

Posted in Subversion

Leave a Reply

Your email address will not be published. Required fields are marked *

*