When Mac fanboys tussle with Windows aficionados, the fur can fly. And at some point, someone will probably bring up the old battery life chestnut: Windows laptops simply run out of juice when you need them most, while Macs just keep on chugging away.

It's a serious problem, as every road warrior fears running out of power right when it's needed the most. Preventing this scenario from happening has quietly emerged as the most significant design trend in mobile computing over the past few years. Smartphones like the Galaxy Note 3, LG G2, and Moto X have prioritized battery life, while power-sipping chips like Intel's Haswell and "Bay Trail" Atom chips now power PCs that offer all-day computing--especially when paired with keyboards or covers with batteries installed inside. And whether to choose Apple or a Windows PC is a perennial debate.

But what we haven't been able to do is to isolate the operating systems themselves, to determine whether the Mac, or Windows, is the most efficient. Part of the problem are the machines themselves. Apple's MacBook Air is a stripped-down, optimized machine that lacks a touchscreen, designed by a company that manufactures the operating system, apps, and a few fixed hardware configurations. Microsoft has to account for all of the variations within the Windows world.

What's going on here?

The genesis of this story was a story by Jeff Atwood, who runs the Coding Horror blog. In it, he examined data supplied by Anand Lal Shimpi of Anandtech, whose results had turned up an odd anomaly back in 2008: using the 15-inch MacBook Pro, he had discovered that the battery life varied dramatically when running three different operating systems on top of the same hardware: OSX 10.5.7, Windows Vista X64 SP1, and the release candidate of Windows 7--in fact, it lasted almost two hours longer under OS X.

Atwood, who owned a Surface Pro and had ordered a Surface Pro 2, was dismayed to find that the expected battery life of the new Surface Pro 2 was just a third better than the previous generation, or about 6.6 hours. (PCWorld is finalizing our own battery-life tests.) Meanwhile, Anandtech's battery life tests indicated that the 11-inch MacBook Air lasted over 11 hours on its Wi-Fi Web surfing tests.

That roused Atwood's ire. "The Surface Pro 2 has a 42 Wh battery, which puts it closer to the 11 inch Air in capacity," he wrote. "Still, over 11 hours of battery life browsing the web on WiFi? That means the Air is somehow producing nearly two times the battery efficiency of the best hardware and software combination Microsoft can muster, for what I consider to be the most common usage pattern on a computer today. That's shocking. Scandalous, even."

We set out to learn more.

Yes, Windows is really less efficient (on the Mac)

To ascertain whether or not Windows crippled battery life, we needed to run different operating systems on identical hardware: in this case, the 2012 "Ivy Bridge"-based 13-inch MacBook Air. We used Apple's latest operating system, OSX 10.9 "Mavericks," as a baseline, and compared it to Windows 7 SP1 and Windows 8.1 using Apple's Boot Camp technology. We set hardware parameters to try and eliminate any hardware effects, preventing the system and display from sleeping, setting the display brightness to a uniform 150 cd/m2, and turning adaptive brightness off.

We then charged up the Air to full capacity and performed our standard Wi-Fi battery rundown test, accessing a series of Web sites until the notebook conked out. The only differences were the default browser (IE 10 for Windows 7, IE11 for Windows 8.1, Safari for the Mac OS). At Microsoft's request, we installed Flash on Safari to ensure that any Web pages were rendered completely.

The results were telling: the MacBook Air running Mac OS X "Mavericks" lasted just over 7 hours, two hours or about 29 percent longer than the Windows 7 PC. And, of course, the data indicates that "upgrading" to Windows 8.1 is really a downgrade in battery life.

So what's going on here? That's a much more complicated question.

Microsoft's explanation: optimized drivers

Naturally, our first call was to Microsoft, for an explanation. They were ready with one.

"What appears to be the most fair comparison is actually the least fair comparison," said Gabriel Aul, director of program management at Microsoft.

Apple's Boot Camp provides a thin layer of code between the operating system and the Mac hardware itself, along with drivers to access the Mac's hardware. Each driver is a bit of code that controls individual components, such as the Wi-Fi radio, for example, or the laptop's display.  But according to Microsoft, the basic Boot Camp installation uses generic or at least un-optimized drivers. (Here's a Macworld explanation of how Boot Camp works.)

And that can make a difference, Aul said. "Device firmware and buses optimized for particular power states can have a huge impact on battery life if you have something  like a radio" that's not properly tuned, he said.

For example, a Wi-Fi radio's default driver setting may be set to maximum power, Aul said, to deliver the best throughput at maximum range. But that may also mean that the battery will drain even faster than usual.  And when the PC constantly powers on the Wi-Fi radio to download Web sites, those small differences can add up.

"What we can observe makes us think that... [Windows] off-the-shelf devices are highly competitive on battery life," Aul said. "On that [Mac], [those drivers] may not be particularly tuned for Windows."

Hardware makers like Asus, Dell, or Lenovo spend a great deal of money tuning those drivers and creating an optimized profile that trades off some performance for battery life, Aul said. Microsoft itself released a firmware update last Friday for the Surface Pro 2 that significantly improves how the OS interacts with the Intel Haswell processor, improving battery life, he said. Apple's Boot Camp simply doesn't go that extra mile.

At face value, Microsoft's explanation is plausible. But could optimized drivers really wave away a two-hour difference in battery life?

Others have suggested alternative explanations. For example, Windows is chock-full of background processes, some of which are polling either the Internet, CPU, or disk for information or updates. At press time, for example, my PC is running eight applications, plus 118 background processes. Could those be adversely affecting battery life?

Aul said they could not. "We spent a great deal of time tuning" the system for I/O prioritization, he said. That means Windows spends a great deal of effort trying to avoid spinning up the disk or touching the CPU for system activities, such as indexing the disk. But if a user is calling up a photo or an application, Windows will piggyback on the request and accomplish a few key tasks. "We want to do that and get out of the way," Aul said.

Extend Windows' battery life even longer

It is  possible, however, that a few poorly-tuned, third-party applications may contribute to a decline in battery life, Aul noted. "For people that used to get great battery life, that's usually the culprit," he said.

Windows also allows users to configure their power settings, either through ultiities provided by the computer manufacturer or via Windows itself. For the latter, the simplest way is to click the small battery icon on the system tray on the lower right. This will bring up a snapshot of the remaining batter charge, and the estimated time to fully exhaust the battery.

If you'd like, you can go further and create your own power plan. In general, a laptop's display and backlight suck up 20 to 25 percent of the typical power within a PC, so telling the laptop to automatically shut them down within a few minutes of inactivity can extend battery life a bit further.

Windows also offers more aggressive options, within the "Control Panel > Hardware and Sound > Power Options > Edit Plan Settings" menu. From here, select the "Change advanced power settings" at the bottom of the window." In the advanced settings, you have the option of limiting the available CPU speed and even controlling the fan.

Keep in mind that this may be overkill. "I usually don't recommend turning on the power saver unless your machine is already overpowered," Aul said. "If you're going to play some games, turning on the power saver defeats the purpose." And as for the advanced options, "I usually don't recommend people tinker with that stuff."

Finally, consider buying Windows hardware designed for longer battery life: Haswell machines offer a mix of low power and performance, and the "Bay Trail" Atom (Atom Z37xx series) allow everything from basic Web browsing up to moderate gaming. Displays with adaptive brightness can dial themselves down when needed. And if you're willing to fork over some additional cash, solid-state-discs (SSDs) offer faster access times and low power.

At this point, we can't say with certainty whether or not Windows or the Mac OS intrinsically offers better battery life. What we do have, however, are some possible explanations for why this is so. Microsoft's Aul suggested that if PCWorld created a so-called "Hackintosh"--a Mac cobbled together and programmed with the Mac OS, and also Windows--that that untuned configuration would favor Windows. There, the problem would be reversed: the Mac OS would be "unaware" of the hardware, and not properly tuned.

What it does suggest, however, is that it's worth buying from the PC manufacturers who are willing to take the time and effort to build a complete, holistic design. It's all well and good to cobble together a desktop machine with disparate parts. But when battery life is factored into the equation, you simply can't go too far to maximize battery life--whether you choose Apple or Windows.