Welcome Guest. | Log In| Register | Membership Benefits

  • Email this page E-mail
  • |  Print Print
  • |   Bookmark and Share
  • icon

The Expert's Guide to Windows 98 WinAlign




WinAlign is an advanced technique for optimizing Windows 98. It is not necessary to use WinAlign to align programs with Windows 98, but it may help you get the maximum performance from your system. If you plan on using WinAlign to optimize files beyond those tested by Microsoft, carefully read the instructions and warnings found here.

If you're looking for the WMAlign.zip download, it's on the WMAlign usage page. Please do read the instructions on the web page before using it.

Why WinAlign is needed
In Windows 95 or NT -- and Windows 98 with unaligned program files -- the program loading sequence goes something like this:

First the OS opens the program file (typically an .EXE or .DLL file) and reads the program code and data, which is put into the system disk cache. Then the OS copies individual code and data sections to new locations in memory so that they are aligned on 4KB virtual-memory page boundaries. Intel-architecture CPUs use a 4KB page size, and each new code or data section must start on a 4KB page boundary.

Immediately after you start a program, it can be quite common for your PC to have two copies of the program code in memory. One is the aligned and running copy of the code; the other is the copy that is still located in the system disk cache. Eventually, other disk activity will flush the no-longer-needed cache copy out of memory.

This fetch-and-copy procedure wastes memory, since it causes the disk cache to be filled with redundant data. It also uses CPU time to perform the copy-and-align procedure. However, it is necessary since the code must be aligned to work with the Intel-architecture virtual memory system that the CPU and OS provide.

The WinAlign solution
Sometime in the Windows 98 development process, a sharp person realized that the operating system could eliminate a lot of the data copying described above if program files were rearranged so that each code or data section started at a 4KB boundary inside the disk file. For that case, Win98 could just load the page from disk and run the aligned code directly from the copy in disk cache memory. In all other cases, Win98 does the same thing as Win95 and performs the extra copy.

The problem with this ingenious optimization technique, of course, is that none of the third-party code that exists today is aligned. (There is a slight chance that all a program's code and data sections already fall onto 4KB boundaries by luck, but it's unlikely.) Microsoft of course aligned all the programs that come with Windows 98, but applications installed on a current Windows 95 system would see no benefit.

Microsoft has been evangelizing the benefits of aligned programs to third-party vendors, so in the future these benefits should come automatically without any action on a user's part. However, you probably want to get some benefit now!. So Microsoft created utilities that would take an existing (unaligned) program file and align it on 4KB boundaries. That way, existing programs -- Microsoft Office in particular -- could take advantage of the performance optimization afforded by aligning code and data.

Alignment is not disk optimization
Don't confuse program file alignment with disk optimization. Both can improve performance, but they are not directly related.

Page 2: 
1 | 2 Next Page »


Subscribe to RSS


Advertisement






Get InformationWeek in Print

Apply for a free 52-week subscription to InformationWeek (a $199 value)



NOTE: Offer valid for U.S., U.S. possessions, & Canada only.