What does Windows' “Tuning up Application Start” do?Windows 98 / XP Dual bootDocumentation on Windows Explorer Shell Command FilesHow to alpha-sort MS-DOS 7.x directoriesSubmarine diver game where you had to collect fish and other things for your aquariumWindows 98 SE installation “hangs”What does “select” mean in a Windows 98 install disc?Windows 98 SE Splash Screen loads foreverIdentify Windows DirectX game about building a manufacturing businessWhy did moving the mouse cursor cause Windows 95 to run more quickly?What made Windows ME so crash-prone?

How does Asimov's second law deal with contradictory orders from different people?

Correct word for a little toy that always stands up?

How to choose using Collection<Id> rather than Collection<String>, or the opposite?

How can flights operated by the same company have such different prices when marketed by another?

Is it okay for me to decline a project on ethical grounds?

May a hotel provide accommodation for fewer people than booked?

Would people understand me speaking German all over Europe?

Is it possible to tell if a child will turn into a Hag?

Was the Psych theme song written for the show?

Should I intervene when a colleague in a different department makes students run laps as part of their grade?

How do you deal with characters with multiple races?

Unknown indication below upper stave

when to use "wait" and when "busy" mouse cursor

Circle symbol compatible with square and triangle

Can living where Earth magnet ore is abundent provide any protection?

Verb Classification of あげる (to give)

How to innovate in OR

How do discovery writers hibernate?

Do the books ever say oliphaunts aren’t elephants?

Efficiently finding furthest two nodes in a graph

How close to the Sun would you have to be to hear it?

When encrypting twice with two separate keys, can a single key decrypt both steps?

Was Donald Trump at ground zero helping out on 9-11?

Is Ear Protection Necessary For General Aviation Airplanes?



What does Windows' “Tuning up Application Start” do?


Windows 98 / XP Dual bootDocumentation on Windows Explorer Shell Command FilesHow to alpha-sort MS-DOS 7.x directoriesSubmarine diver game where you had to collect fish and other things for your aquariumWindows 98 SE installation “hangs”What does “select” mean in a Windows 98 install disc?Windows 98 SE Splash Screen loads foreverIdentify Windows DirectX game about building a manufacturing businessWhy did moving the mouse cursor cause Windows 95 to run more quickly?What made Windows ME so crash-prone?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








24















When installing an old version of Windows, there is a step about application start tuning:



enter image description here



This is not about the PREFETCH folder, since this feature appeared in Windows XP.



Question:



Does anyone know what Windows performs during this step?










share|improve this question






























    24















    When installing an old version of Windows, there is a step about application start tuning:



    enter image description here



    This is not about the PREFETCH folder, since this feature appeared in Windows XP.



    Question:



    Does anyone know what Windows performs during this step?










    share|improve this question


























      24












      24








      24


      1






      When installing an old version of Windows, there is a step about application start tuning:



      enter image description here



      This is not about the PREFETCH folder, since this feature appeared in Windows XP.



      Question:



      Does anyone know what Windows performs during this step?










      share|improve this question














      When installing an old version of Windows, there is a step about application start tuning:



      enter image description here



      This is not about the PREFETCH folder, since this feature appeared in Windows XP.



      Question:



      Does anyone know what Windows performs during this step?







      windows-98 windows-me






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 21 at 2:16









      AybeAybe

      1,9132 gold badges10 silver badges30 bronze badges




      1,9132 gold badges10 silver badges30 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          24














          At that point, Setup executes WALIGN.EXE. Some information could be found back then at Microsoft's Knowledge Base (*1):




          Winalign.exe and Walign.exe (*2) optimize programs by rewriting a program's file headers, creating a new section table, and then writing file sections, each of which starts on a 4-kilobyte (KB) boundary. The new section table is then updated with this information, and the file headers are also updated to denote the file is now aligned to a 4-KB boundary. By aligning files in this manner, the Windows 98 CacheMap feature can map directly to sections in the cache memory. This can result in significant performance increases by freeing memory.




          Wiki, BTW, also notes this under Performance Improvements in the Win98 entry:




          On the FAT32 file system, Windows 98 has a performance feature called MapCache that can run applications from the disk cache itself if the code pages of executable files are aligned/mapped on 4K boundaries, instead of copying them to virtual memory. This results in more memory being available to run applications, and lesser usage of the swap file.




          and




          WinAlign (Walign.exe and Winalign.exe) are tools designed to optimize the performance of executable code (binaries). WinAlign aligns binary sections along 4 KB boundaries, aligning the executable sections with the memory pages. This allows the Windows 98 MapCache feature to map directly to sections in cache.[25] Walign.exe is included in Windows 98 for automatically optimizing Microsoft Office programs. Winalign.exe is included in the Windows 98 Resource Kit to optimize other programs.




          WALIGN.EXE is distributed with the system install but looks only out for (older) MS programs which are not aligned. WINALIGN.EXE can be used for a general optimization.



          The workings are based on the improved (disk) cache handling of Win98 offering the MapCache feature. It allows to map a cache page into program memory. Effectively switching from use of classic paging (for program files) to memory mapped (code) files.




          At that point some history/theory of operating systems, program loading and virtual memory might be helpful:



          A classic program load means loading the code portion(s) from disk, execute them and if there's a shortage of memory, the least needed code gets moved out into a paging file, to be reloaded when needed again. That's a costly (and slow) disk operation, every time a code segment gets purged.



          Like all disk operations this can be sped up by a disk cache. Except, taking cache memory from main memory may decrease performance, in tight memory situations, by having less memory for programs, resulting in programs being purged which could have resided happily in main memory without a cache taking up room.



          Some OSes optimized this by not swapping out code segments, but reloading them from its (EXE) file. Just this involves reading its block(s) from disk into a read buffer and then transferring it bytewise into the program memory before execution.



          In a further step this can already be improved by aligning code segments to disk block/cluster boundaries, thus reducing the number of disk blocks read to a minimum (*3), as well as allowing to load code directly into program memory, not going thru read buffers and/or disk caches.



          While the later does add considerable performance, but also opens several dilemmas in OS design.



          • By direct loading into program memory, sparing all levels of disk caching, may as well loose quite some performance. Especially if there is free space in cache.

          • On the other hand, loading it via the regular load path (including cache) it may again add to memory hogging, as now the code resides in cache and program memory at the same time.

          A (*4) tricky question isn't it?




          Instead of fiddling around the issues as done before, MS took a bold step with Win98 and turned the problems into a solution by adding MapCache. MapCache allows to map (disk) cache pages into program memory (*5). Now, whenever a program gets loaded, its code segment get loaded quite the ordinary way thru the disk cache. But then they are not copied into program memory, but mapped in by just changing the corresponding page entry (*6).



          As a result loading a segment becomes a single read operation, followed by no copy needed. Paging it out becomes (almost) zero effort, and reloading is again just a single operation - with the bonus if paged out due some other reason than memory shortage, it may still be in disk cache. In fact, disk cache now turns into a virtual page manager able to balance program and data load at the same time.



          Quite clever, isn't it.



          Of course, to have all of these benefits, code segments needed to be (memory) page aligned. That's were the 4 KiB size comes from (natural page size for 386ff). And WINALIGN.EXE does this for programs that are not already aligned (*7).



          Back then there have been some fuzz that Win98 bloats programs. Well, it doesn't, it just inserts some filler to align the segments on page boundaries.




          *1 - The relevant articles are no longer available online (except for some cache inconsistency). The excerpt is taken from an ancient MSDN disk - jup, back then, they did not just point to their online resources :)



          *2 - WALIGN.EXEis a dedicated version for Office 98.



          *3 - As there can be no partial block at the beginning of a segment.



          *4 - Well, there are a few more pitfalls, but of lesser importance - and as well served by MapCache.



          *5 - Simplified, there are more use cases including memory mapped files an so on, but that's a different story.



          *6 - Plus some bookkeeping to let the system remember that the block is not only used, but also mapped to some other address space and what for. This needs to be taken into account before reusing the block, to not impact performance the wrong way.



          *7 - It also keeps a list of 'optimized' programs at HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionWinalign. This not only helps to avoid doing the job twice, but was quite useful to exclude programs from being optimized - like for if they needed special alignment situations, like for direct access to their EXE file, but didn't walk the headers, but accessed these data with fixed offset. Usually for ... well, let's call it 'features'.






          share|improve this answer






















          • 2





            I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

            – Stephen Kitt
            Jul 21 at 13:50






          • 1





            @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

            – Raffzahn
            Jul 21 at 14:14


















          8














          In short, Windows aligns application code on 4kb memory boundaries to load applications faster from disk or memory cache.
          This works well for large applications like office, internet browsers, graphic editors...



          A good detailed explanation can be found here:



          https://www.techrepublic.com/article/speed-up-windows-98-applications-with-winalign/






          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "648"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f11734%2fwhat-does-windows-tuning-up-application-start-do%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            24














            At that point, Setup executes WALIGN.EXE. Some information could be found back then at Microsoft's Knowledge Base (*1):




            Winalign.exe and Walign.exe (*2) optimize programs by rewriting a program's file headers, creating a new section table, and then writing file sections, each of which starts on a 4-kilobyte (KB) boundary. The new section table is then updated with this information, and the file headers are also updated to denote the file is now aligned to a 4-KB boundary. By aligning files in this manner, the Windows 98 CacheMap feature can map directly to sections in the cache memory. This can result in significant performance increases by freeing memory.




            Wiki, BTW, also notes this under Performance Improvements in the Win98 entry:




            On the FAT32 file system, Windows 98 has a performance feature called MapCache that can run applications from the disk cache itself if the code pages of executable files are aligned/mapped on 4K boundaries, instead of copying them to virtual memory. This results in more memory being available to run applications, and lesser usage of the swap file.




            and




            WinAlign (Walign.exe and Winalign.exe) are tools designed to optimize the performance of executable code (binaries). WinAlign aligns binary sections along 4 KB boundaries, aligning the executable sections with the memory pages. This allows the Windows 98 MapCache feature to map directly to sections in cache.[25] Walign.exe is included in Windows 98 for automatically optimizing Microsoft Office programs. Winalign.exe is included in the Windows 98 Resource Kit to optimize other programs.




            WALIGN.EXE is distributed with the system install but looks only out for (older) MS programs which are not aligned. WINALIGN.EXE can be used for a general optimization.



            The workings are based on the improved (disk) cache handling of Win98 offering the MapCache feature. It allows to map a cache page into program memory. Effectively switching from use of classic paging (for program files) to memory mapped (code) files.




            At that point some history/theory of operating systems, program loading and virtual memory might be helpful:



            A classic program load means loading the code portion(s) from disk, execute them and if there's a shortage of memory, the least needed code gets moved out into a paging file, to be reloaded when needed again. That's a costly (and slow) disk operation, every time a code segment gets purged.



            Like all disk operations this can be sped up by a disk cache. Except, taking cache memory from main memory may decrease performance, in tight memory situations, by having less memory for programs, resulting in programs being purged which could have resided happily in main memory without a cache taking up room.



            Some OSes optimized this by not swapping out code segments, but reloading them from its (EXE) file. Just this involves reading its block(s) from disk into a read buffer and then transferring it bytewise into the program memory before execution.



            In a further step this can already be improved by aligning code segments to disk block/cluster boundaries, thus reducing the number of disk blocks read to a minimum (*3), as well as allowing to load code directly into program memory, not going thru read buffers and/or disk caches.



            While the later does add considerable performance, but also opens several dilemmas in OS design.



            • By direct loading into program memory, sparing all levels of disk caching, may as well loose quite some performance. Especially if there is free space in cache.

            • On the other hand, loading it via the regular load path (including cache) it may again add to memory hogging, as now the code resides in cache and program memory at the same time.

            A (*4) tricky question isn't it?




            Instead of fiddling around the issues as done before, MS took a bold step with Win98 and turned the problems into a solution by adding MapCache. MapCache allows to map (disk) cache pages into program memory (*5). Now, whenever a program gets loaded, its code segment get loaded quite the ordinary way thru the disk cache. But then they are not copied into program memory, but mapped in by just changing the corresponding page entry (*6).



            As a result loading a segment becomes a single read operation, followed by no copy needed. Paging it out becomes (almost) zero effort, and reloading is again just a single operation - with the bonus if paged out due some other reason than memory shortage, it may still be in disk cache. In fact, disk cache now turns into a virtual page manager able to balance program and data load at the same time.



            Quite clever, isn't it.



            Of course, to have all of these benefits, code segments needed to be (memory) page aligned. That's were the 4 KiB size comes from (natural page size for 386ff). And WINALIGN.EXE does this for programs that are not already aligned (*7).



            Back then there have been some fuzz that Win98 bloats programs. Well, it doesn't, it just inserts some filler to align the segments on page boundaries.




            *1 - The relevant articles are no longer available online (except for some cache inconsistency). The excerpt is taken from an ancient MSDN disk - jup, back then, they did not just point to their online resources :)



            *2 - WALIGN.EXEis a dedicated version for Office 98.



            *3 - As there can be no partial block at the beginning of a segment.



            *4 - Well, there are a few more pitfalls, but of lesser importance - and as well served by MapCache.



            *5 - Simplified, there are more use cases including memory mapped files an so on, but that's a different story.



            *6 - Plus some bookkeeping to let the system remember that the block is not only used, but also mapped to some other address space and what for. This needs to be taken into account before reusing the block, to not impact performance the wrong way.



            *7 - It also keeps a list of 'optimized' programs at HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionWinalign. This not only helps to avoid doing the job twice, but was quite useful to exclude programs from being optimized - like for if they needed special alignment situations, like for direct access to their EXE file, but didn't walk the headers, but accessed these data with fixed offset. Usually for ... well, let's call it 'features'.






            share|improve this answer






















            • 2





              I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

              – Stephen Kitt
              Jul 21 at 13:50






            • 1





              @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

              – Raffzahn
              Jul 21 at 14:14















            24














            At that point, Setup executes WALIGN.EXE. Some information could be found back then at Microsoft's Knowledge Base (*1):




            Winalign.exe and Walign.exe (*2) optimize programs by rewriting a program's file headers, creating a new section table, and then writing file sections, each of which starts on a 4-kilobyte (KB) boundary. The new section table is then updated with this information, and the file headers are also updated to denote the file is now aligned to a 4-KB boundary. By aligning files in this manner, the Windows 98 CacheMap feature can map directly to sections in the cache memory. This can result in significant performance increases by freeing memory.




            Wiki, BTW, also notes this under Performance Improvements in the Win98 entry:




            On the FAT32 file system, Windows 98 has a performance feature called MapCache that can run applications from the disk cache itself if the code pages of executable files are aligned/mapped on 4K boundaries, instead of copying them to virtual memory. This results in more memory being available to run applications, and lesser usage of the swap file.




            and




            WinAlign (Walign.exe and Winalign.exe) are tools designed to optimize the performance of executable code (binaries). WinAlign aligns binary sections along 4 KB boundaries, aligning the executable sections with the memory pages. This allows the Windows 98 MapCache feature to map directly to sections in cache.[25] Walign.exe is included in Windows 98 for automatically optimizing Microsoft Office programs. Winalign.exe is included in the Windows 98 Resource Kit to optimize other programs.




            WALIGN.EXE is distributed with the system install but looks only out for (older) MS programs which are not aligned. WINALIGN.EXE can be used for a general optimization.



            The workings are based on the improved (disk) cache handling of Win98 offering the MapCache feature. It allows to map a cache page into program memory. Effectively switching from use of classic paging (for program files) to memory mapped (code) files.




            At that point some history/theory of operating systems, program loading and virtual memory might be helpful:



            A classic program load means loading the code portion(s) from disk, execute them and if there's a shortage of memory, the least needed code gets moved out into a paging file, to be reloaded when needed again. That's a costly (and slow) disk operation, every time a code segment gets purged.



            Like all disk operations this can be sped up by a disk cache. Except, taking cache memory from main memory may decrease performance, in tight memory situations, by having less memory for programs, resulting in programs being purged which could have resided happily in main memory without a cache taking up room.



            Some OSes optimized this by not swapping out code segments, but reloading them from its (EXE) file. Just this involves reading its block(s) from disk into a read buffer and then transferring it bytewise into the program memory before execution.



            In a further step this can already be improved by aligning code segments to disk block/cluster boundaries, thus reducing the number of disk blocks read to a minimum (*3), as well as allowing to load code directly into program memory, not going thru read buffers and/or disk caches.



            While the later does add considerable performance, but also opens several dilemmas in OS design.



            • By direct loading into program memory, sparing all levels of disk caching, may as well loose quite some performance. Especially if there is free space in cache.

            • On the other hand, loading it via the regular load path (including cache) it may again add to memory hogging, as now the code resides in cache and program memory at the same time.

            A (*4) tricky question isn't it?




            Instead of fiddling around the issues as done before, MS took a bold step with Win98 and turned the problems into a solution by adding MapCache. MapCache allows to map (disk) cache pages into program memory (*5). Now, whenever a program gets loaded, its code segment get loaded quite the ordinary way thru the disk cache. But then they are not copied into program memory, but mapped in by just changing the corresponding page entry (*6).



            As a result loading a segment becomes a single read operation, followed by no copy needed. Paging it out becomes (almost) zero effort, and reloading is again just a single operation - with the bonus if paged out due some other reason than memory shortage, it may still be in disk cache. In fact, disk cache now turns into a virtual page manager able to balance program and data load at the same time.



            Quite clever, isn't it.



            Of course, to have all of these benefits, code segments needed to be (memory) page aligned. That's were the 4 KiB size comes from (natural page size for 386ff). And WINALIGN.EXE does this for programs that are not already aligned (*7).



            Back then there have been some fuzz that Win98 bloats programs. Well, it doesn't, it just inserts some filler to align the segments on page boundaries.




            *1 - The relevant articles are no longer available online (except for some cache inconsistency). The excerpt is taken from an ancient MSDN disk - jup, back then, they did not just point to their online resources :)



            *2 - WALIGN.EXEis a dedicated version for Office 98.



            *3 - As there can be no partial block at the beginning of a segment.



            *4 - Well, there are a few more pitfalls, but of lesser importance - and as well served by MapCache.



            *5 - Simplified, there are more use cases including memory mapped files an so on, but that's a different story.



            *6 - Plus some bookkeeping to let the system remember that the block is not only used, but also mapped to some other address space and what for. This needs to be taken into account before reusing the block, to not impact performance the wrong way.



            *7 - It also keeps a list of 'optimized' programs at HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionWinalign. This not only helps to avoid doing the job twice, but was quite useful to exclude programs from being optimized - like for if they needed special alignment situations, like for direct access to their EXE file, but didn't walk the headers, but accessed these data with fixed offset. Usually for ... well, let's call it 'features'.






            share|improve this answer






















            • 2





              I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

              – Stephen Kitt
              Jul 21 at 13:50






            • 1





              @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

              – Raffzahn
              Jul 21 at 14:14













            24












            24








            24







            At that point, Setup executes WALIGN.EXE. Some information could be found back then at Microsoft's Knowledge Base (*1):




            Winalign.exe and Walign.exe (*2) optimize programs by rewriting a program's file headers, creating a new section table, and then writing file sections, each of which starts on a 4-kilobyte (KB) boundary. The new section table is then updated with this information, and the file headers are also updated to denote the file is now aligned to a 4-KB boundary. By aligning files in this manner, the Windows 98 CacheMap feature can map directly to sections in the cache memory. This can result in significant performance increases by freeing memory.




            Wiki, BTW, also notes this under Performance Improvements in the Win98 entry:




            On the FAT32 file system, Windows 98 has a performance feature called MapCache that can run applications from the disk cache itself if the code pages of executable files are aligned/mapped on 4K boundaries, instead of copying them to virtual memory. This results in more memory being available to run applications, and lesser usage of the swap file.




            and




            WinAlign (Walign.exe and Winalign.exe) are tools designed to optimize the performance of executable code (binaries). WinAlign aligns binary sections along 4 KB boundaries, aligning the executable sections with the memory pages. This allows the Windows 98 MapCache feature to map directly to sections in cache.[25] Walign.exe is included in Windows 98 for automatically optimizing Microsoft Office programs. Winalign.exe is included in the Windows 98 Resource Kit to optimize other programs.




            WALIGN.EXE is distributed with the system install but looks only out for (older) MS programs which are not aligned. WINALIGN.EXE can be used for a general optimization.



            The workings are based on the improved (disk) cache handling of Win98 offering the MapCache feature. It allows to map a cache page into program memory. Effectively switching from use of classic paging (for program files) to memory mapped (code) files.




            At that point some history/theory of operating systems, program loading and virtual memory might be helpful:



            A classic program load means loading the code portion(s) from disk, execute them and if there's a shortage of memory, the least needed code gets moved out into a paging file, to be reloaded when needed again. That's a costly (and slow) disk operation, every time a code segment gets purged.



            Like all disk operations this can be sped up by a disk cache. Except, taking cache memory from main memory may decrease performance, in tight memory situations, by having less memory for programs, resulting in programs being purged which could have resided happily in main memory without a cache taking up room.



            Some OSes optimized this by not swapping out code segments, but reloading them from its (EXE) file. Just this involves reading its block(s) from disk into a read buffer and then transferring it bytewise into the program memory before execution.



            In a further step this can already be improved by aligning code segments to disk block/cluster boundaries, thus reducing the number of disk blocks read to a minimum (*3), as well as allowing to load code directly into program memory, not going thru read buffers and/or disk caches.



            While the later does add considerable performance, but also opens several dilemmas in OS design.



            • By direct loading into program memory, sparing all levels of disk caching, may as well loose quite some performance. Especially if there is free space in cache.

            • On the other hand, loading it via the regular load path (including cache) it may again add to memory hogging, as now the code resides in cache and program memory at the same time.

            A (*4) tricky question isn't it?




            Instead of fiddling around the issues as done before, MS took a bold step with Win98 and turned the problems into a solution by adding MapCache. MapCache allows to map (disk) cache pages into program memory (*5). Now, whenever a program gets loaded, its code segment get loaded quite the ordinary way thru the disk cache. But then they are not copied into program memory, but mapped in by just changing the corresponding page entry (*6).



            As a result loading a segment becomes a single read operation, followed by no copy needed. Paging it out becomes (almost) zero effort, and reloading is again just a single operation - with the bonus if paged out due some other reason than memory shortage, it may still be in disk cache. In fact, disk cache now turns into a virtual page manager able to balance program and data load at the same time.



            Quite clever, isn't it.



            Of course, to have all of these benefits, code segments needed to be (memory) page aligned. That's were the 4 KiB size comes from (natural page size for 386ff). And WINALIGN.EXE does this for programs that are not already aligned (*7).



            Back then there have been some fuzz that Win98 bloats programs. Well, it doesn't, it just inserts some filler to align the segments on page boundaries.




            *1 - The relevant articles are no longer available online (except for some cache inconsistency). The excerpt is taken from an ancient MSDN disk - jup, back then, they did not just point to their online resources :)



            *2 - WALIGN.EXEis a dedicated version for Office 98.



            *3 - As there can be no partial block at the beginning of a segment.



            *4 - Well, there are a few more pitfalls, but of lesser importance - and as well served by MapCache.



            *5 - Simplified, there are more use cases including memory mapped files an so on, but that's a different story.



            *6 - Plus some bookkeeping to let the system remember that the block is not only used, but also mapped to some other address space and what for. This needs to be taken into account before reusing the block, to not impact performance the wrong way.



            *7 - It also keeps a list of 'optimized' programs at HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionWinalign. This not only helps to avoid doing the job twice, but was quite useful to exclude programs from being optimized - like for if they needed special alignment situations, like for direct access to their EXE file, but didn't walk the headers, but accessed these data with fixed offset. Usually for ... well, let's call it 'features'.






            share|improve this answer















            At that point, Setup executes WALIGN.EXE. Some information could be found back then at Microsoft's Knowledge Base (*1):




            Winalign.exe and Walign.exe (*2) optimize programs by rewriting a program's file headers, creating a new section table, and then writing file sections, each of which starts on a 4-kilobyte (KB) boundary. The new section table is then updated with this information, and the file headers are also updated to denote the file is now aligned to a 4-KB boundary. By aligning files in this manner, the Windows 98 CacheMap feature can map directly to sections in the cache memory. This can result in significant performance increases by freeing memory.




            Wiki, BTW, also notes this under Performance Improvements in the Win98 entry:




            On the FAT32 file system, Windows 98 has a performance feature called MapCache that can run applications from the disk cache itself if the code pages of executable files are aligned/mapped on 4K boundaries, instead of copying them to virtual memory. This results in more memory being available to run applications, and lesser usage of the swap file.




            and




            WinAlign (Walign.exe and Winalign.exe) are tools designed to optimize the performance of executable code (binaries). WinAlign aligns binary sections along 4 KB boundaries, aligning the executable sections with the memory pages. This allows the Windows 98 MapCache feature to map directly to sections in cache.[25] Walign.exe is included in Windows 98 for automatically optimizing Microsoft Office programs. Winalign.exe is included in the Windows 98 Resource Kit to optimize other programs.




            WALIGN.EXE is distributed with the system install but looks only out for (older) MS programs which are not aligned. WINALIGN.EXE can be used for a general optimization.



            The workings are based on the improved (disk) cache handling of Win98 offering the MapCache feature. It allows to map a cache page into program memory. Effectively switching from use of classic paging (for program files) to memory mapped (code) files.




            At that point some history/theory of operating systems, program loading and virtual memory might be helpful:



            A classic program load means loading the code portion(s) from disk, execute them and if there's a shortage of memory, the least needed code gets moved out into a paging file, to be reloaded when needed again. That's a costly (and slow) disk operation, every time a code segment gets purged.



            Like all disk operations this can be sped up by a disk cache. Except, taking cache memory from main memory may decrease performance, in tight memory situations, by having less memory for programs, resulting in programs being purged which could have resided happily in main memory without a cache taking up room.



            Some OSes optimized this by not swapping out code segments, but reloading them from its (EXE) file. Just this involves reading its block(s) from disk into a read buffer and then transferring it bytewise into the program memory before execution.



            In a further step this can already be improved by aligning code segments to disk block/cluster boundaries, thus reducing the number of disk blocks read to a minimum (*3), as well as allowing to load code directly into program memory, not going thru read buffers and/or disk caches.



            While the later does add considerable performance, but also opens several dilemmas in OS design.



            • By direct loading into program memory, sparing all levels of disk caching, may as well loose quite some performance. Especially if there is free space in cache.

            • On the other hand, loading it via the regular load path (including cache) it may again add to memory hogging, as now the code resides in cache and program memory at the same time.

            A (*4) tricky question isn't it?




            Instead of fiddling around the issues as done before, MS took a bold step with Win98 and turned the problems into a solution by adding MapCache. MapCache allows to map (disk) cache pages into program memory (*5). Now, whenever a program gets loaded, its code segment get loaded quite the ordinary way thru the disk cache. But then they are not copied into program memory, but mapped in by just changing the corresponding page entry (*6).



            As a result loading a segment becomes a single read operation, followed by no copy needed. Paging it out becomes (almost) zero effort, and reloading is again just a single operation - with the bonus if paged out due some other reason than memory shortage, it may still be in disk cache. In fact, disk cache now turns into a virtual page manager able to balance program and data load at the same time.



            Quite clever, isn't it.



            Of course, to have all of these benefits, code segments needed to be (memory) page aligned. That's were the 4 KiB size comes from (natural page size for 386ff). And WINALIGN.EXE does this for programs that are not already aligned (*7).



            Back then there have been some fuzz that Win98 bloats programs. Well, it doesn't, it just inserts some filler to align the segments on page boundaries.




            *1 - The relevant articles are no longer available online (except for some cache inconsistency). The excerpt is taken from an ancient MSDN disk - jup, back then, they did not just point to their online resources :)



            *2 - WALIGN.EXEis a dedicated version for Office 98.



            *3 - As there can be no partial block at the beginning of a segment.



            *4 - Well, there are a few more pitfalls, but of lesser importance - and as well served by MapCache.



            *5 - Simplified, there are more use cases including memory mapped files an so on, but that's a different story.



            *6 - Plus some bookkeeping to let the system remember that the block is not only used, but also mapped to some other address space and what for. This needs to be taken into account before reusing the block, to not impact performance the wrong way.



            *7 - It also keeps a list of 'optimized' programs at HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionWinalign. This not only helps to avoid doing the job twice, but was quite useful to exclude programs from being optimized - like for if they needed special alignment situations, like for direct access to their EXE file, but didn't walk the headers, but accessed these data with fixed offset. Usually for ... well, let's call it 'features'.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 21 at 18:34

























            answered Jul 21 at 11:44









            RaffzahnRaffzahn

            65.7k6 gold badges160 silver badges272 bronze badges




            65.7k6 gold badges160 silver badges272 bronze badges










            • 2





              I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

              – Stephen Kitt
              Jul 21 at 13:50






            • 1





              @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

              – Raffzahn
              Jul 21 at 14:14












            • 2





              I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

              – Stephen Kitt
              Jul 21 at 13:50






            • 1





              @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

              – Raffzahn
              Jul 21 at 14:14







            2




            2





            I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

            – Stephen Kitt
            Jul 21 at 13:50





            I can’t find them based on the info here, but if you have the KB numbers, they might be available on Jeff Parsons’ archive.

            – Stephen Kitt
            Jul 21 at 13:50




            1




            1





            @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

            – Raffzahn
            Jul 21 at 14:14





            @StephenKitt Oh, thats a niche page. Gotta keep that. The number I have here would be 191655.

            – Raffzahn
            Jul 21 at 14:14













            8














            In short, Windows aligns application code on 4kb memory boundaries to load applications faster from disk or memory cache.
            This works well for large applications like office, internet browsers, graphic editors...



            A good detailed explanation can be found here:



            https://www.techrepublic.com/article/speed-up-windows-98-applications-with-winalign/






            share|improve this answer





























              8














              In short, Windows aligns application code on 4kb memory boundaries to load applications faster from disk or memory cache.
              This works well for large applications like office, internet browsers, graphic editors...



              A good detailed explanation can be found here:



              https://www.techrepublic.com/article/speed-up-windows-98-applications-with-winalign/






              share|improve this answer



























                8












                8








                8







                In short, Windows aligns application code on 4kb memory boundaries to load applications faster from disk or memory cache.
                This works well for large applications like office, internet browsers, graphic editors...



                A good detailed explanation can be found here:



                https://www.techrepublic.com/article/speed-up-windows-98-applications-with-winalign/






                share|improve this answer













                In short, Windows aligns application code on 4kb memory boundaries to load applications faster from disk or memory cache.
                This works well for large applications like office, internet browsers, graphic editors...



                A good detailed explanation can be found here:



                https://www.techrepublic.com/article/speed-up-windows-98-applications-with-winalign/







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 21 at 10:14









                CK70CK70

                811 bronze badge




                811 bronze badge






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Retrocomputing Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f11734%2fwhat-does-windows-tuning-up-application-start-do%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?