<<< Saturday, June 21, 2003 12:30 PM


Human Pattern Recognition >>>

Windows Paging

Saturday,  06/21/03  09:19 PM

Does anyone understand why Windows paging is  s o   s l o w ?

Paging is the biggest reason why Windows is so much slower than other operating systems like Linux.  But if that is so, surely I'm not the only one to notice?  And if I'm not, why hasn't someone in Redmond reverse-engineered Linux' paging and adapted it for Windows?  The problem is the same regardless of the system's APIs and GUIs, so a better paging scheme should just, er, be better.

I just spent fifteen minutes waiting for Windows to page in a large program.  I had been running this program (an image viewer) and then loaded another large program (an image compressor) which paged the first program out.  After the new program was done, I activated the old one, and its working set of 512MB took 15 minutes to page back in.  Meanwhile loading that program from scratch and filling its 512MB cache takes less than one minute.  This just does not make sense...

On a Windows box you "fall off a cliff" as soon as the working set exceeds the amount of physical memory in the machine.  (If you don't believe this, you obviously don't manipulate large images.)  And once you're paging, Windows seems to take forever to pull stuff back.  There just isn't any obvious reason why it should be so bad at this.  Meanwhile with Linux you can routinely run with a working set twice the size of the physical memory, or more...  and there is no falling off a cliff, performance just gradually degrades as paging takes place.  This is one reason why Linux will run well on a box with less memory, it just doesn't have to have as much physical memory to support a certain size working set.  (There are lots of other reasons, too, like the fact that the Linux resident kernel is about ten times smaller than Windows.)

Macs used to have slow paging, too, in the old days before OSX.  Slow but not as slow as Windows.  But now with OSX Macs have a Unix kernel, and they have fast paging.  This is another reason among many why Photoshop runs better on Macs, you just don't have to have enough memory to keep everything loaded.

You would think that this is not a subtle fact.  You would think that with all the really smart talent at Microsoft, someone would deal with this.  A faster paging scheme would immediately make every Windows system everywhere much faster.  (I wonder if there is an opportunity for a third-party accelerator, which patched itself into Windows and replaced the paging algorithms?)

So, I'm really curious, does anyone understand this?