Startup apps start up when I tell them


I remember some magazine article about Windows 8, and it talked about how fast Windows 8 started up compared to Windows 7. The way they measured it was by putting a shortcut to Notepad in the Startup group, then booting the computer, and timing how long before the Notepad window opened.

I laughed at this metric because I control when startup groups start up. As in me, personally.

The Explorer startup sequence has a number of phases, carefully arranged to get visible things ready first, and less visible things ready later. And one of the lowest priority items is the Startup group.

In fact, even after everything is finished initializing, there is a bonus extra delay before the Startup group gets processed. We've found that one of the big frustrations people have with Windows is that after signing in, they can't use the computer because all of the Startup programs are thrashing the computer. Launching all the programs in the Startup group and similar auto-start locations (like the Run key) means that you have a dozen programs all trying to load themselves off the disk, which thrashes the computer so hard that the user can't even open the Start menu.

There have been a variety of approaches taken to mitigate the impact of auto-start programs. One trick was to run auto-start programs in a box that keeps them at low CPU and disk priority for 60 seconds. In Windows 8, one new trick was to delay launching the next program until the previous one has settled down, where "settled down" means "stopped consuming a lot of CPU and disk I/O bandwidth." Another trick was simply to wait longer before starting the auto-start programs in the first place.

Measuring how long it takes for Notepad to open is in large part simply a way of extracting the parameter I passed to the Sleep function.

I could have made Windows boot faster or slower according to their metrics by simply tweaking how long I slept before firing up the auto-start programs.

Comments (29)
  1. 12BitSlab says:

    Raymond, I assume that Microsoft (or possibly you) have some sort of internal metric for Windows startup. How do you measure it?

  2. French Guy says:

    I have always found startup programs annoying (especially since I never put a single program on that list). And removing stuff from there wasn’t as easy as I wished.

    1. Yukkuri says:

      B-b-b-but Contoso Superstar Program Deluxe is so awesome why would you NOT want it to run at startup? Obviously you removed it on accident and it needs more reliable ways to make sure its splash screen is in your face when your PC boots.

      1. Joshua says:

        Contoso Superstar Program Deluxe just got banished to a VM! It wants to think the universe is all about itself: it just got its way.

        1. Muzer says:

          Hah, this made me think of the total perspective vortex and how Zaphod Beeblebrox managed to survive it — that he really WAS the centre of the universe.

  3. BZ says:

    I imagine this was done because Windows 8 would not boot to the desktop normally. Otherwise they would just measure how long it took for the full desktop to load – still a very bad metric as on Windows 10 it can thrash around for quite awhile to open anything from a fully visible desktop on startup. So how do you measure the real startup time?

    1. Josh B says:

      Enabling and looking at the profiling counters is probably your best bet. You can see when the CPU & disk queues go from pegged to spiking to steady that way, when interrupts slow down, and so on. Specifically looking at explorer.exe’s full initialization might be even more useful (parts of it are still starting up even after the UI appears), since that’s how everyone starts interacting with the PC, but I’m not sure how you’d do that as someone who isn’t Raymond.

  4. Nico says:

    Has the approach changed much with modern hardware? I would guess that a CPU with multiple cores paired with a solid state drive would greatly reduce the amount of thrashing that takes place when multiple programs start executing at the same time. But that’s just a guess.

    Though perhaps there are other benefits of a more serialized initialization. For example, I could see getting more advantage of shared code pages if many startup programs use the same libraries.

    1. Even on an SSD, there is a lot of I/O contention at system startup.

    2. Josh B says:

      A lot of software has expanded to fill the hardware. One starts up Java, one starts up .Net, one Python and one GTK, drivers load their UI components even if they don’t show them, everything injects itself into the shell… There’s also the particular pathology that they all want to update immediately on startup, instead of waiting and checking periodically. Any antivirus update will probably stall the system completely for a minute or three. Meanwhile services are doing all of their work in the background at the same time, unless you let the PC sit for a while before logging in. Lots of hardware makes it more bearable, but it’s still a bad situation if it’s unmanaged.

      1. Deltics says:

        >One starts up Java, one starts up .Net, one Python and one GTK, ..
        > .. it’s still a bad situation if it’s unmanaged.

        You will note the things in your opening list.

        I think it would be quite accurate to revise your closing observation to an observation that: “a bad situation is made worse thanks to everything that is now managed”. :)

  5. roeland says:

    > We’ve found that one of the big frustrations people have with Windows is that after signing in, they can’t use the computer because all of the Startup programs are thrashing the computer.

    Cue sad laughter.

    I bought a laptop a couple of years ago (when it still came with Windows 7, and a mechanical harddrive). And sure enough, out of the box it was basically an expensive paperweight for the first 10 or so minutes after starting it up.

    The culprit was easy to find: about a dozen of programs running on startup, out of the box. One of these programs did a hard-drive performance check on starting up! Hello, shovelware. Back then, after unboxing, the next step was installing a clean copy of Windows.

    But hey, at least my laptop actually finished starting up. I once witnessed another laptop starting up, thrashing, thrashing, and thrashing more for about half an hour, until it ran out of battery power and shut down.

    I’m wondering: running those programs one after each other: is that how Windows 10 figures out how much “impact” a program has on start-up?

  6. alegr1 says:

    > you have a dozen programs all trying to load themselves off the disk, which thrashes the computer so hard

    Why doesn’t the loader load (touches to page in) the whole module at Load, to make all reads linear (>100 MB/s on modern HDD)? That would speed up the process load A LOT. Assuming the Explorer would call WaitForInputIdle.

    1. smf says:

      Disk I/O at startup is not just loading applications, there will also be an impact from paging and whatever the applications are doing. The applications may also be thrashing the CPU.

      Machines that take ages to start up often don’t have much ram, after you preloaded all the pages then they could just get discarded again.

      I assume SuperFetch, Prefetch and the boot optimisation essentially give you roughly the same advantage in a different way.

      1. alegr1 says:

        >Machines that take ages to start up often don’t have much ram,
        We’re not in that decade or century anymore.

        >there will also be an impact from paging and whatever the applications are doing.
        Freshly allocated memory doesn’t need page-in.

        1. ZLB says:

          Hmm…it can do. When backing address space with physical pages, they may be taken from another process and will require zero’ing to stop data leaking across processes.

          1. alegr1 says:

            1. Amount of private code in a typical process is under 10 megabytes. A typical box always has a much memory in a standby list. Keep in mind, it’s not year 2000 anymore.
            2. The article is about system startup, when there are no big user apps running yet. Even if there are, there’s always enough non-dirty pages to steal.

        2. Josh B says:

          You seem to be under the impression that code pages are the only disk reads, and not the many hundreds of megabytes of data above and beyond that (for whatever stupid reason startup apps have).

    2. DWalker says:

      Why would you intentionally touch all parts of a module? There might be parts of a module that NEVER need to be brought in, and your suggestion would force these parts to be brought in unnecessarily.

      1. alegr1 says:

        >There might be parts of a module that NEVER need to be brought in, and your suggestion would force these parts to be brought in unnecessarily.

        I’m happy to pay that little cost. Just as Windows is happy to pay the little cost of dong page-in to dummy pages to coalesce page-in I/O.

  7. Ray Koopa says:

    That explains why some background program I put into Startup now suddenly doesn’t immediately appear “right after” log-in but 10 seconds later after I changed from Windows 7 to Windows 10.

    1. JDG says:

      Try using a scheduled task instead. It can be configured to run x seconds after login (including 0).

  8. Martin Ba. _ says:

    Feels like this is a good place to say that MS really did great work wrt. startup issues from Win7 to Win8/10. It’s *so* much better in 8/10. Thanks for that.

  9. MarcK4096 says:

    I found the new behavior undesirable. I’d start using the computer and then 10 seconds later an auto-start program would change the foreground window causing my keystrokes to start going into a void. Setting StartupDelayInMSec to 0 has improved the experience a lot for me. Thanks for including this setting in the registry.

  10. DWalker says:

    There are measurements, stored in the Event Log, that tell you how long various phases of Startup take. Anyone who is interested in checking out how long “startup” takes (and startup is a nebulous concept) should investigate those. They are in the Windows-Diagnostics-Performance set. For example, events 100 through 110 will tell you about performance degradation during startup. One of the events says something like “Windows has started up” (I’m paraphrasing from memory).

    Remember that there are services set to “Automatic (Delayed)” which delays their startup to some unspecified time, like when the system “has settled down”.

    1. DWalker says:

      Correction: Startup is not a nebulous concept, but “how long startup takes” probably has different meanings to different people.

    2. 12BitSlab says:

      Thanks for the heads up. I will look into those metrics.

  11. Scarlet Manuka says:

    The last clause (“… tweaking how long I slept before firing up the auto-start programs”) makes me envisage a tiny little Raymond Chen inside my PC, waiting for a timer to go off so that he, personally, can kick off my auto-start programs. So thanks for an amusing mental image, Raymond!

    1. DWalker says:

      There are hundreds of millions (or billions) of tiny little Raymond Chens running inside all Windows PCs!

Comments are closed.

Skip to main content