Exponential algorithm making Windows XP miserable could be fixed

A decade of patches makes svchost.exe a very sad boy indeed.

Windows XP is really old, and we would suggest that you don't use it unless you really have no option. For the most part, however, that age doesn't really manifest itself. Sure, the operating system is missing the security features, hardware acceleration, and built-in support for things like USB 3 that newer versions of Windows have, but old software doesn't have the same issues as, say, old cars. Old software generally runs as well today as it did when it was brand new.

But Windows XP users have noticed that this isn't entirely true. A bunch of them have found that the old operating system is working considerably worse than when it was released in 2001. The problem is that—especially among those who are still using Internet Explorer 6 or 7—each time you boot your Windows XP machine, it slows to a crawl. There's a built-in process, svchost.exe, chewing up the entire processor, sometimes for an hour or more at a time. Wait long enough after booting and the machine will eventually return to normalcy. But an hour can be a long time to wait.

Loss of horsepower and trouble starting up are common enough problems in old cars, but we don't really expect the same things to happen on old PCs.

It looks as if Microsoft has figured out what the problem is—though not at the first time of asking. It's all down to Windows Update. Machines using Windows Update retrieve patch information from Microsoft's servers. That patch information contains information about each patch: what software it applies to (for example, systems that have been upgraded to Internet Explorer 7 or 8 don't need Internet Explorer 6 patches), what knowledge base article it relates to, and, critically, what historic patch or patches the current patch supersedes.

Windows patches are mostly cumulative. On a fresh install of Windows XP, you don't need to install all of the dozens of Internet Explorer 6 patches sequentially; you can generally just install the latest patch, and it will include all the historic fixes because it supersedes the historic patches that introduced those fixes.

Unfortunately, the Windows Update client components used an algorithm with exponential scaling when processing these lists. Each additional superseded patch would double the time taken to process the list. With the operating system now very old, those lists have grown long, sometimes to 40 or more items. On a new machine, that processing appeared to be almost instantaneous. It is now very slow.

Microsoft thought that it had this problem fixed in November's Patch Tuesday update after it culled the supersedence lists. That update didn't appear to fix the problem. The company thought that its December update would also provide a solution, with even more aggressive culling. That didn't seem to help either. Although the company said that it did test these updates, for one reason or another, its test scenarios didn't reflect the experience of real Windows XP machines.

There is hope that a true fix will be developed. The company says that it is working on a new supersedence logic that will "comprehensively solve this problem" and that this work is a "top priority," with "all the right (and smartest) people" working on it. Unfortunately, there's no ETA just yet.

If the fix doesn't come soon, one suspects that it may never come. Microsoft will cease to update Windows XP in April 2014. At this point, Windows XP users will be able to solve the problem for themselves anyway: they can simply turn off Windows Update forever, since it will no longer update their systems anyway.

The company says that it is working on a new supersedence logic that will "comprehensively solve this problem" and that this work is a "top priority," with "all the right (and smartest) people" working on it. Unfortunately, there's no ETA just yet.

So in short, this will be fixed once you buy Windows 8 and stop using XP.

Well, this explains a great deal. I was relegated to an ancient XP laptop for the month of November. I wondered why it was slow when windows first loaded it. It was horrible. Steam taking an hour to launch.

I really hope Microsoft can get this licked before the end of support. I don't intend to use XP much, but old legacy devices are reliant on the OS.

I'm actually kind of shocked this is getting any attention at all from Microsoft. There comes a point when cutting back support makes sense - and this is well past that time frame. Putting top talent on such a miniscule problem - which will solve itself in 18 weeks is - well - shocking! Free XP support has gone on long enough. This top talent should be working on Windows 8, not on XP.

I use XP in a virtual machine quite often. I've been noticing an svhost.exe process that sucks up 99% of the allocated cpu time. Unfortunately, killing said process seems to kill the ability of the machine to play videos smoothly. I've been trying to identify which service inside the .exe wrapper is the one responsible.

The article doesn't state it explicitly but I believe the service you want to turn off in Administrative Tools is the 'Automatic Updates' service. I'm going to try that now and see if it fixes my system.

Edit: Indeed, disabling the Automatic Update service reduced the cpu load of svchost processes. As I read Ars I'll know when to update my image on patch Tuesday.

What blows my mind is that for the amount of code in the patches and service packs, Microsoft could have easily rewritten all of Windows XP several times. And, I've always wondered how many times they did patches for things that they patched, which was patched 3 times before that as well.

I think Microsoft also still wants XP to be useable, and this problem threatens its very use.

Despite it not being supports their customers still use it, and thus their experience to a certain point, should be positive. Some things like this problem can be solved, some other serious problems, cannot be solved because of the simple fact ( Vista, Windows 7, Windws 8.x ) have already solved them.

Why bother fixing it at all? Seems like a lot of work for 4-5 months of results.

Well, maybe the algorithm is not exclusive to XP? Perhaps Vista, 7 and 8 will go down the same, slow, road soon enough, in which case it might be a good idea to solve it...

The version of Windows Update that shipped with Vista was totally rewritten, mostly because the XP one is such a dog. It doesn't seem to be having this issue on any system I have, but it's not been 15 years. I first started noticing XP's update site was really slow several years ago so we'll know soon.

I'm actually kind of shocked this is getting any attention at all from Microsoft. There comes a point when cutting back support makes sense - and this is well past that time frame. Putting top talent on such a miniscule problem - which will solve itself in 18 weeks is - well - shocking! Free XP support has gone on long enough. This top talent should be working on Windows 8, not on XP.

As another posted has said it might only be effecting XP now but I would be surprised if they didn't use similar code in Vista/7/8.

Also I'm not 100% but I don't think MS will be removing the current patches just stopping putting new ones out. So while "Support" ends in April this issue could continue on long after that.

I don't get why the client needs to figure out supercedence at all. When a superceding patch is installed, just flag all of the uninstalled superceded patches as unneeded. One patch to Windows Update could install this logic and remove the O(n2) algorithm entirely.

Edit: jandrese informs us that it is O(2n) which is much worse than O(n2). Yikes!

Edit 2: For the downvoters, I am genuinely curious why this wouldn't work. When you install Update 12345, it knows that it supersedes Updates 12300, 12321 and 12342. Suppose 12321 and 12342 are not installed on the client. It should be easy as part of 12345 to install stub versions of 12321 and 12342 that would prevent the client from ever looking at those updates again. Presto, process time goes from O(2n) to O(n).

Since this problem is related to the age of the OS (really, the number of patches released, but that's basically the same thing) then it stands to reason that Vista should be starting to see the effects too. How about it Vista users? Does the OS feel slow to you?

I have to test my software against XP VM's and I noticed last week all of them were using 100% CPU. I thought maybe some malware was involved, so I trashed the VM's and deployed new XP SP3 machines from a template. Even those were using 100% CPU the instant windows update started.

The hotfixes mentioned in this post solved the problem for me, at least for now. (XP SP3 IE6)

It would be somewhat hilarious if fixing this issue somehow lead to a resurgence of Windows XP usage, with people finding that it's suddenly just as snappy as Win7. (There's still the looming security update cutoff, of course)

Even if the problem only exists on XP, I know of several Fortune 500 companies that still have very large install bases of XP and IE8...they have all this critical in-house software that depends upon an ancient computing ecosystem, and it takes a long time for them to develop and roll out replacements.

I don't get why the client needs to figure out supercedence at all. When a superceding patch is installed, just flag all of the uninstalled superceded patches as unneeded. One patch to Windows Update could install this logic and remove the O(n2) algorithm entirely.

How would you like to be the kat at Microsoft that has to still work on patches and fixes for XP.

My guess there are as many or more developers at Microsoft working on products that already have a newer version out, than those actually working on current software versions. With every latest Windows release, there are between 2-4 old releases still under support. xbox 360 has to have a full team of devs, even though the xbox one is out. Office is the same way. Visual Studio, SQL Server, etc...

It's nice of MS to try to do something about this, but at this point in time they have better things to be doing.

Here's just one example: getting Metro better integrated with the classic win32 for instance. Seamless transition between laptop and tablet mode is a really big deal, and if they're going to keep windows relevant then they need to get that worked out. WIn 8 had the right idea, but the implementation wasn't very good. That needs to be fixed, and Microsoft's attention needs to be focused on stuff like that, like online services, like Windows Phone ... stuff that matters

Fixing XP? Waste of time. XP has been a dead OS walking since Win 7 was released, and it's not worth messing with bar security patches.

One thing to note as to why Microsoft may be working on a fix: even though *Microsoft* will no longer be pushing updates past April 2014, companies using internal update servers (WSUS) could release patches to their environment at any time, possibly years after the last provided update. These, of course, wouldn't be new or custom updates, just updates that an organization finally deems stable enough to deploy in their environment. There is a lot that goes into that calculation for large enterprise IT organizations, which is why XP is still on the desktop after three new OS revisions and a minor release beside.

I have companies using 20+ machines each that are still on Windows XP. One of my main support contracts, use an in house developed program that uses the Access Runtime. It will not install on Windows Vista or newer. This company in question is in the process of programming a new software on the .NET platform, but it is not ready yet. I still need to fix computers and get them running on Windows XP so that they can run the software they have at this time. I don't think that there is any need to stop the ability of Windows XP to connect and download updates, even after April 2014. I can understand not developing new updates, fixes, etc.. But to just prevent any downloads is incomprehensible. This needs to be fixed now, and if Microsoft doesn't want to support XP fine, release the patches to another company who will at least have the archive of files available to the public!

A way to edit the server that the microsoft update program goes to would be nice too!

I have companies using 20+ machines each that are still on Windows XP. One of my main support contracts, use an in house developed program that uses the Access Runtime. It will not install on Windows Vista or newer. This company in question is in the process of programming a new software on the .NET platform, but it is not ready yet. I still need to fix computers and get them running on Windows XP so that they can run the software they have at this time. I don't think that there is any need to stop the ability of Windows XP to connect and download updates, even after April 2014. I can understand not developing new updates, fixes, etc.. But to just prevent any downloads is incomprehensible. This needs to be fixed now, and if Microsoft doesn't want to support XP fine, release the patches to another company who will at least have the archive of files available to the public!

nope; enables a bad situation

unless this 3rd party company has access to the XP source code, then at best you could say it's secure as of April 2013. How long do you think that's going to last? You just know there's blackhats hanging onto undiscovered XP vulnerabilities just waiting for May with glee.

People that plan to run XP past April are frankly, being negligent at their jobs. Software that doesn't support anything newer then XP? Too bad, that should have been addressed in the year and years of warning that people had.

We don't want even more people running unpatched copies of XP, which is what would happen with your idea

It's funny how one of XPs drawbacks became how much users and companies loved it. I know way too may personal users and enterprise deployments that are clinging on to XP with a death grip. It makes me wonder whether Windows 7 will get the same treatment.

I work in tech support, and in the last month Windows XP drove me mad. One day I cleaned up an XP machine (C2D E4300, 1GB RAM) and it took a few hours (!!!) to start retrieving updates from Microsoft's servers (it just sat there checking for updates...). Luckily I had other things to do in the meantime.

I'm not sure if Microsoft intentionally ignored this problem for the past month, just to force people to upgrade. Unfortunately I still have a lot of computers running Windows XP and I'm trying to convince my customers to upgrade to Win 7, but for some of them it's a costly proposition and they just can't afford it.