Wednesday, February 27, 2008

So your computer doesn't work or crawls

This is sometimes the most common complaint of someone who shelled out a good amount of money for a computer. The problem lies in the fact that configuring a computer is as much a science as an art, and even experienced computer scientists may (and mostly :D ) get it wrong, or not the best possible one for the amount of money you've paid. One of the big reasons I want to write this post is the deluge of poorly configured and doomed-to-fail configurations I see being sold in India.

Now the interesting part, computers aren't that compilcated, it's just that the people who design and develop things like to show they're doing something, and some are mathematicians (shock,horror). Now I have nothing against mathematicians, but most of them have this obsession for things called "correctness" and "completeness", which is what causes a lot of your problems. This tends to create complicated terms for simple things, which in well, obfuscated english, is called obfuscation, or simply unnecessary complication. Want examples? try googling some of the common acronyms your hear. But it's not like computer scientists are mad to complicate things, some of these definitions carry extra meaning than what their english meanings imply.

So lets get back to what I meant in the title. The most common problem is computers running slow. And I don't mean running slow later in its life, I mean slow to start with. I'm writing this on a computer with a 1.6Ghz processor with 256MB of ~200Mhz RAM, which (to anyone who knows anything about hardware) is a joke. The bigger joke is that the computer is an IBM Thinkpad. Now the standard Windows XP installation after bootup requires around 380MB of memory. So why are global corporations selling computers which will run excruciatingly slowly? If you haven't realised by now, the excess 120MB or so will be swapped in and out of disk, which is about a 100 times slower than memory. And, the even more wonderous, Windows Vista uses about 750MB at the first boot onwards. So how big does that leave your 1GB (or 1024MB) of RAM? not too big eh? Add to this, even your run-of-the-mill internet browser uses around 20MB of memory. To do what you might ask, well only the programmers know. But even this is after endless rounds of optimization, so it's not as bad.

I was introduced to computers on a 8086 which ran at something around 1Mhz, and the first computer I owned was a 386 (at a lightning fast 20MHz), with 4MB RAM and 80MB of disk. I've seen Windows grow from it's very first avataars to the behemoth it is today. I concede, it is still the easiest to use even today, amidst the onslaught of Linux, even I prefer it to Linux. It's again become pretty stable (Windows 3.1 never crashed in my lifetime :D) but it's still too big. So the best you can do, is get sufficient amounts of RAM(memory). Processors have become fast enough that lower megahertz don't hurt as much as lower MB of memory. Keep an eye out for 1 biggest number that's never advertised, cache. Most current processors have 2MB (of L2 cache, I might add for purists sake, ignore if you're a layman), and Celeron's have less of it. Even 1 MB less of this hits, and hits hard. Why? Your processor is like this guzzler, and memory and cache are the carts that get stuff to it from your disk, that larger they are, the more chunks you get to the processor, as simple as that. The guzzler has grown faster than the carts, and only very few people in the world can write programs for very few problems that keep the guzzler occupied at all times. In your usual computer, your processor does useful work for very little time, i.e. uses a small percentage of its thinking power, like we use our heads, only about 10% (it's true).

And if computers scare you, don't be, they've been designed by idiots like me and you, and just confidently use your common sense. In all the time I've experimented, I've never lost any data of worth, which you won't if you do your homework, and don't delete or format things mindlessly. So the next time you see a cryptic error, try googling it rather than call tech support, don't understand the terms? google them as well. You'll find that the answers you find will be better than what techsupp will give you. Any normal person can fix most of their problems if they just pay a little attention and devote a little time, and think what they would do if they designed something like this.

3 comments:

Spec123 said...

Nice post!

1. Computers are not designed by idiots.
2. VISTA uses huge amounts of memory only because it "prefetches" pages of programs that you use frequently into the memory. It frees memory automatically when you need it. Having free memory is like locking money as cash!
3. To quote the great Rob Pike, "store what is difficult to compute" (The Practice of Programming). I hope this sheds light on programs using more memories these days.
4. Make computer hardware cheap so that you can achieve more from them (whether its a good user experience or fast processing).
5. The key to make your computer faster is to make your memory fast (and not big) as you rightly put when you talked about swapping.

apollo said...

I meant that some of the configurations in the market defy common sense, ergo someone is doing something seriously wrong. Also, the time I used vista, I didn't like the performance of the prefetching algo that much, the performance advantage is probably cancelled by the extra load it's put in. The justification for that load is obviously debatable, some of it is security, but a lot is visual appeal, which wears off quickly. Plus my view of the OS has been that it shud interfere very little with what you wanna do, and stick to offering the basic abstractions. XP was a gud balance, it was solid, offered a few frills, but they never interfered with the performance.

Well, mebbe the advent of flash based hard-disks will improve performance, Dell has started offering them, and the reviews praised them. so hopefully that next leap, if cheaper can make performance improve.

Spec123 said...

Aye! I too feel that flash based hard drives will improve situations. But allow me to elaborate more on Vista efficiency issues.

Vista performs slow is probably an exaggeration. All the "glossy" features and in fact all the "presentation" in Vista is done by WPF (Windows Presentation Foundation) and in particular by milcore.dll. Technicalities aside, WPF guarentees that it will execute as much of rendering on the GPU (meaning your graphics card) and not the CPU (meaning processor and memory). Only when you run out of GPU resources will Vista use software rendering. Since your machine is a bit old (in terms of the graphics card it uses) it is not probably fit enough to run Vista but believe me, I have been using it for about an year now and it is better than XP when it comes to performance (I have run XP and Vista side by side), and it is much more reliable too. The problem with XP on newer hardware is that it does not fully employ the potential (which in this case would improve efficiency a lot). I also fail to see why security features would bog down performance.