Why is simple stuff sometimes so slow?

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
I was pondering on this at work.

Lot of simple processes in various programs seems to be WAY slower then it has to be, why is this?

Examples:

1:Fsecure checking for updates, takes over 20 minutes just to check! Why? All it should be doing is sending a ~2 byte packet to the server containing the date stamp of last update, client should then send a ~2 byte packet to say yes or no, then if yes, it starts downloading. Even if the packet is 1KB due to more complex encoding techniques, no reason why this process should take more then 1 second.

2: Windows update! When you do "install updates and shut down". At this point the updates are already downloaded. These are files that are a couple megs. It's basically replacing DLLs and maybe editing the registry. Why should this take more then 30 seconds? Sometimes it takes HOURS!

Theres tons of others, but those are the two I can think of right now. Things like doing a defrag, format, or scandisk I can understand as it has to do tons of processing, but stuff like copy a couple files or send/recv a few packets, why?

I just don't understand how these simple things can take so long, what exactly do they do to make it take so long?
 

akhilles

Senior member
Nov 6, 2007
336
0
0
1. You're not the only customer.

2. Could be locked files that Windows is trying to unlock. I'm pretty sure MS tested their updates on a stock PC with a fresh install. However, our pc's are modded beyond recognition. I'm using uxtheme.dll for 3rd-party themes. That's just one thing.

I will bet $10 that if you wipe the drive clean & reinstall windows, things will be a lot faster.
 

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
1. still should not take that long, specially considering its on a 100mps lan and the packet to find out if new updates are ready should not even be that big if its coded properly.

2. if theres files locked or other issues it should actually just give an error not just sit there forever since its not like it has to wait on something - it cna't do it period.

Keep in mind those two are just examples. I just find I see so much stuff these days thats horribly coded and could be done much better.
 

iBPJohn

Member
Jun 10, 2008
108
0
0
It sounds like there is something wrong with your computer, do these things take that long all the time?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
1:Fsecure checking for updates, takes over 20 minutes just to check! Why? All it should be doing is sending a ~2 byte packet to the server containing the date stamp of last update, client should then send a ~2 byte packet to say yes or no, then if yes, it starts downloading. Even if the packet is 1KB due to more complex encoding techniques, no reason why this process should take more then 1 second.

It's probably using HTTP so it's definitely going to require more than ~2bytes, but it still shouldn't take very long.

2: Windows update! When you do "install updates and shut down". At this point the updates are already downloaded. These are files that are a couple megs. It's basically replacing DLLs and maybe editing the registry. Why should this take more then 30 seconds? Sometimes it takes HOURS!

I have XP in a VM at work and it goes pretty quick and I can attribute any delays to disk I/O.
 

Quiksilver

Diamond Member
Jul 3, 2005
4,725
0
71
Originally posted by: RedSquirrel
1:Fsecure checking for updates, takes over 20 minutes just to check! Why? All it should be doing is sending a ~2 byte packet to the server containing the date stamp of last update, client should then send a ~2 byte packet to say yes or no, then if yes, it starts downloading. Even if the packet is 1KB due to more complex encoding techniques, no reason why this process should take more then 1 second.

2: Windows update! When you do "install updates and shut down". At this point the updates are already downloaded. These are files that are a couple megs. It's basically replacing DLLs and maybe editing the registry. Why should this take more then 30 seconds? Sometimes it takes HOURS!

Theres tons of others, but those are the two I can think of right now. Things like doing a defrag, format, or scandisk I can understand as it has to do tons of processing, but stuff like copy a couple files or send/recv a few packets, why?

I just don't understand how these simple things can take so long, what exactly do they do to make it take so long?

1) Sounds like you need a new AV if it's taking this long, the longest AntiVir has ever taken for me was 6 minutes, but that's cause they were having problems with their servers, on average it takes me less than 2 minutes and it doesn't nag me about it.

2) I have not once ever seen a windows update take hours to update, the longest updates for me were those frameworks packages taking maybe 15 minutes total to download and then install.

3) Defragging can take a very long time if you don't do it often, but if you do it on a daily/weekly basis it can be very quick taking less than 2/3 minutes.

In short:
If you bother to keep up with product updates, keep bloated software to a minimum, and take care of your PC by cleaning up trash and defragging you don't encounter annoying problems.
 

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
Most of this stuff I witness at work, so could be their network, but still, even over super slow dialup speeds, a simple "is june-19-08 the latest definition?" packet sent to a server should not take more then 1 second, if its coded properly and does not overcomplicate the whole process. That seems to be an issue with lot of programs today, they overcomplicate simple processes, and just automatically assume "oh well computers are fast now, I don't have to write efficient code".
 

Quiksilver

Diamond Member
Jul 3, 2005
4,725
0
71
Originally posted by: RedSquirrel
Most of this stuff I witness at work, so could be their network, but still, even over super slow dialup speeds, a simple "is june-19-08 the latest definition?" packet sent to a server should not take more then 1 second, if its coded properly and does not overcomplicate the whole process. That seems to be an issue with lot of programs today, they overcomplicate simple processes, and just automatically assume "oh well computers are fast now, I don't have to write efficient code".

Well if it's at work, take say 100 employees all using the computer, surfing web, streaming music, whatever shouldn't be done (cause you know they are); and in the middle of that an program update that needs to get through your busy network, to another busy network, and back. Its gonna take awhile compared to say a personal user at home with 2/3 computers. until something happens on the server front or media used from point a to b (eg. all fiber).

You also have to factor in hash checks to make sure your getting non-corrupt data and what not too.

Most cases I would take hard drives as being what takes the longest compared to everything else, I would hope this changes when SSD's begin getting popular and fast for a cheap price.

I can only think of one example of that last bit.... Crysis.
 

seemingly random

Diamond Member
Oct 10, 2007
5,277
0
0
Originally posted by: RedSquirrel
oh I'm just talking in general, not just my computer.

These things have been witnessed all over, from work PCs to home PCs.
I know what you mean but can't put my finger on an example right now except for the huge amount of time for xp sp3 and vista sp1 updates.

I do believe in some cases that it is apparently inefficient coding. There are so many layers to go through now days. I believe though that this is the price we pay for the relative stability and enormous amount of features. When you hear someone brag about get something done in very little time, you know that it's probably inefficient.

I've noticed sometimes that cpu usage (and hence temps) is up a lot (60-80%) sometimes with just 15-20 browser windows open. When all windows are shut and then reopened, usage is 2-5%. That's with just anandtech and a few other similar sites. I attribute it to adobe flash but can't say for sure.
 

seemingly random

Diamond Member
Oct 10, 2007
5,277
0
0
One of my biggest gripes about Vista is the slooow file copy in windows explorer. It feels like 10 times slower than xp even when the source and destination are on different drives. And it's not just huge directory trees. It's very slow with a single multi-gb file. In fact, it feels so slow, it seems artificially slow although I can't come up with any good reason for this.
 

akhilles

Senior member
Nov 6, 2007
336
0
0
Well, I think it's good business strategy as it may force the customer to keep upgrading. :D
 

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
Happens all the time, maybe its because they're coded badly to deal with domain policies and such - but domain policies are a microsoft thing, so they really have no excuse. We've had people do "shut down and install updates" before leaving work then next morning help desk is flooded with calls with people trying to get in only to realize their PC is STILL "updating". Bet you unplug the hard drive and it still sits there, since its actually not even DOING anything. Its like with the Fsecure "checking..." thing, you can run a packet sniffer, and theres actually no data going through, its just sitting there for no reason.
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
Originally posted by: seemingly random
One of my biggest gripes about Vista is the slooow file copy in windows explorer. It feels like 10 times slower than xp even when the source and destination are on different drives. And it's not just huge directory trees. It's very slow with a single multi-gb file. In fact, it feels so slow, it seems artificially slow although I can't come up with any good reason for this.

This may shed some light on your file copy comparison.

Originally posted by: RedSquirrel
Happens all the time, maybe its because they're coded badly to deal with domain policies and such - but domain policies are a microsoft thing, so they really have no excuse. We've had people do "shut down and install updates" before leaving work then next morning help desk is flooded with calls with people trying to get in only to realize their PC is STILL "updating". Bet you unplug the hard drive and it still sits there, since its actually not even DOING anything. Its like with the Fsecure "checking..." thing, you can run a packet sniffer, and theres actually no data going through, its just sitting there for no reason.

Install filemon/regmon/process explorer and you'd be amazed how busy windows actually is underneath the hood apparently doing nothing. This is besides the point anyway as there are a million reasons why things can be slow.

I think you maybe don't fully understand how some system components work. Take dll's, what happens if they are currently in use by other programs not under windows control? If the dll is pulled from under their feet they'd most likely crash horrifically and who would get the blame from then end user? Microsoft! Sure lots of things could and should be better, but nothing is as easy as one usually perceives.

Then you have to deal with end users who have the potential to mess up system settings .........
 

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
But if its in use, why just wait days? nothing will change until the user forces a power off. They could find a way to put it somewhere, add a "log" that it has to be copied, then when you reboot it would copy, or at least something. So no reason why this needs to take so long if done properly.

But yeah I've seen in reg/filemon how busy windows is at doing nothing. Its nuts.
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
Windows does routinely swap files that were locked during a reboot, which is why some updates require a reboot although this is thankfully getting less and less. The common practise is that if a file is in use then do a few wait/retry loops to see if the lock drops else schedule it in during a reboot cycle. These wait periods are usually 30 sec to 1 min retries.

The real problem is the intelligence in detecting how a file/program is in use. What you would ideally want to do is detect that if a file is in use fine out what program is. If this program is under user control then inform then to try extract a decision on what to do else do the whole retry thing.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Windows does routinely swap files that were locked during a reboot, which is why some updates require a reboot although this is thankfully getting less and less. The common practise is that if a file is in use then do a few wait/retry loops to see if the lock drops else schedule it in during a reboot cycle. These wait periods are usually 30 sec to 1 min retries.

The better solution is to do it like unix, allow the renaming and deletion of open files. The data stays on disk and the handle to the old file is still valid to running things stay running and new things will use the new file. You can then recommend a reboot or allow the user to just restart things that use that file.
 

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
Originally posted by: Nothinman
Windows does routinely swap files that were locked during a reboot, which is why some updates require a reboot although this is thankfully getting less and less. The common practise is that if a file is in use then do a few wait/retry loops to see if the lock drops else schedule it in during a reboot cycle. These wait periods are usually 30 sec to 1 min retries.

The better solution is to do it like unix, allow the renaming and deletion of open files. The data stays on disk and the handle to the old file is still valid to running things stay running and new things will use the new file. You can then recommend a reboot or allow the user to just restart things that use that file.

Yeah I like how in *nix you can modify files that are "in use". Heck, you can even do a full disk delete if you really want and it will still run, sorta. (as soon as it needs to access a file then it fails obviously) Thats why you hardly ever have to reboot Linux. Just need to restart services.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yeah I like how in *nix you can modify files that are "in use".

That's questionable and isn't possible with binaries. Executables, shared libraries, etc are all locked from modification when they're running.
 

Red Squirrel

No Lifer
May 24, 2003
69,654
13,295
126
www.betteroff.ca
Thats another of my pet peeves. It's all that junk that some programs like to add in those menues, but again, looking up a couple entries has no reason to take that long if properly coded. Or even things like getting the properties box on an item. I can understand it taking some time to get the file size info as it has to run through all the folders, but the box itself should not take ages to come up, which it does on some systems I find.
 

pcslookout

Lifer
Mar 18, 2007
11,959
156
106
Originally posted by: RedSquirrel
Thats another of my pet peeves. It's all that junk that some programs like to add in those menues, but again, looking up a couple entries has no reason to take that long if properly coded. Or even things like getting the properties box on an item. I can understand it taking some time to get the file size info as it has to run through all the folders, but the box itself should not take ages to come up, which it does on some systems I find.

I seen this as well on some systems. Takes forever at times to come up when right clicking.
 

seemingly random

Diamond Member
Oct 10, 2007
5,277
0
0
Originally posted by: Shadow Conception
Why the hell does my right click menu take so long to load?
If it's slow after the first time in the same app, then there are other problems in the pc. It may be as simple as ram starvation. I haven't noticed this problem for years...