So I got a new machine. Windows 11. Brand new. It's stuck updating. It is taking ages. Why? Well, I don't have any definitive answers but my most basic instinct is to always attach a profiler -- I recommend the excellent @superluminal .

It turns out that there is this thing in the background, TiWorker.exe, and it's taking its dear time while burning through CPU cycles. This is part of the "Windows Module Installer" service, which handles updates.

Why does it take so long? Some cleanup! Seemingly, for every single package, we:
1) create some "Execution Object"
2) execute it
3) clean it up
Creating the object takes 2.8s. Deleting the object takes roughly 16s. Running the actual operation takes 125ms. So about 99.5% is just overhead.
Deleting the request takes 16s because every new request spins up a new "Servicing Querier", which then starts preloading "all components" (16s!), and we need to wait for this to finish before we can move on _and then repeat the same thing for the next package_.
Creating the request takes 2s because it enumerates all packages. Does it have to do that from scratch every time? The request by the way spends the majority of the time just persisting state to disk. (Maybe that's necessary because someone might kill this?)

I have no idea whom to tell that at Microsoft. Is this a known problem? Are there good reasons for this? Am I holding it wrong?

But I have done some back-of-the-napkin math: At roughly 19s per package, and assuming I have 10000 packages installed, and assuming there are no additional such steps, the update will hopefully finish in 53 hours.

I'll add a post when the update has finished.

It finished! I had already waited for a day when I started to look into what went wrong (with some restarts). Not sure what the precise walltime then is, but it's somewhere in the 30h range.

In a cruel twist, there are now two more updates, and they just fail immediately :)

@sschoener they took “fail early and fail fast” advice seriously

@aras I actually prefer this to waiting for two days while something assures me that they "are definitely still doing important work so please don't kill the process."

It's scary to think how many times I just kill stuff because I don't think that it can possibly be doing meaningful work for so long, haha.