WhiteSites Blog

What is Cache

Posted on Jul 5, 2008 by Paul White

10 years ago you didn't hear a whole lot about Cache.  That was because most all computers had 256 K of cache or less.  The focus was always on the CPU's clock speed.  From a marketing standpoint this was ideal.  Its not hard to explain to a person that a 100 Mhz Pentium is faster than a 90 Mhz Pentium.  This simplistic Marketing Model made it easy for consumers to rate computers and feel confident about their purchase.  Also during this time most of the Tech companies were making tons of money.  If you had stock in just about any computer company in 1998, by 2000 you were almost ready to retire.  Of course we had the .com crash in 2000, of which many stocks never recovered from..

Back to the issue at hand.  Around 2003. Pentium 4 PCs were the latest and greatest.  But we soon started to get clock speeds pushing 4 Ghz.  High Clock speeds are great, and some serious Computer Geeks have Over clocked their chips to over 6 Ghz.  The problem is with high clock speeds your chip makes more heat.  Getting rid of this heat requires large heat sinks, and for the over clocking crowd, liguid cooling or even liquid nitrogen cooling.  The Problem is even though you have a chip that can tear through instructions at 3-4 Ghz.  It had some disadvantages.  These faster chips made alot of heat, mainly due to being based on a 5 Volt system.  By dropping the Voltage you reduce the amount of heat you produce.  This might not seem like a big deal to most home owners.  If you leave your computer on 24/7 it might cost you a few dollars in electricity.  But if you run a Datacenter with 5000 Servers, Reducing heat can save you alot on your utility bill.  As its not just the 150 watts that is pushed through the chip, but also the Air conditioning required to keep the Datacenter Cool.  Even though the Marketing Model for chips based on the Clock Speed has worked well.  Manufacturers were going to have to step back and start focusing on the slower components.  There is little Intel or AMD can do about the Hard Drive speed or the Ram Speed. but they could reduce the amount of trips they make to the Hard Drive or Ram.  To do this they started to increase the amount of cache on the chips.

Even though the core of the chips can move at high speeds, your cache is slightly slower.  Cache typically comes in 3 levels.  Level 1, Level 2, Level 3.  With Level 1 being the fastest, and level 3 being the slowest.  Even though Level 1 is fast it is also very expensive, and is not high density.  By sacraficing speed Intel and AMD will put slower Level 2 or Level 3 Cache on the chip that has a higher density.  Even today you might only see 16 K of Level 1 cache on a chip.  While it may have 2-12 Megs of Level 2 or 3 cache.  Cache is not something you can upgrade, as it is part of your Chip.  If you want more cache you have to buy a new chip.  When your CPU is working on data, it first goes to the Cache to see if they data it wants is there.  If not then it goes to the Level 2 and 3 cache.  If not then it goes to the RAM. If not then it goes to the Hard drive or any other Media you might have.  This might not seem like a big deal, but lets put this into terminology that most people can understand.

Pretend you are a mechanic making some repairs on a car.  After some work you figure the car needs a new altenator.  If you had the altenator right there on your bench you would pick it up and make the repair.  In all the repair took 5 minutes.  Now for the relations.  You ( the mechanic ) represent the CPU.  Your Bench Represents Level 1 cache, and the new altenator represents the Data.  The time to make the repair is how long it takes for your to retrieve and work with the data.  5 minutes would be your best case senereo. of course in the computer world you are really talking about a few nano seconds.

Now lets assume you don't have the part you need at your bench, but you do have a small inventory of parts.  You check your inventory room and get the alternator and make the repair.  This time it took you 10 minutes to make the repair.  Your inventory room would be Level 2 or Level 3 cache. 

Now lets assume you don't have the part in your inventory.  So you call a local autoparts store and have them bring one over to you.  You spend an hour waiting for the autoparts store to deliver the part to you, then it takes you 5 minutes to add the part to your inventory and 5 minutes to do the install.  So you now took 1 hour and 10 minutes to the repair.  In this example the autoparts store would be your RAM.  RAM is much slower than your cache and anytime you have to retreive something from your RAM it is causing a hit on performance.

Now lets assume you called the autoparts store and they didn't have the part in stock.  They say they will have to order it.  The Part is made in China ( like most stuff ), so now you wait for 2 weeks for the part to be shipped accross the ocean.  The autoparts store takes a day to get the part into its inventory, then calls you and has it brought over.  You take 5 minutes to add it to your inventory and then installl the part.  So the repair took 2 weeks, 1 day, and 10 minutes.  The Factory in China would be your Hard Drive.  Anytime you need data from your Hard Drive there is a huge delay.

In the previous examples notice how your mechanic spend most of its time waiting on parts.  The same goes for your CPU.  You spend alot of time waiting on data, and very little time on processing the data.   This is why chips today have higher amounts of cache.  Where 10 years ago you might have an inventory of say 10 parts. You now have 500 parts in your inventory.  This saves you trips to your AutoParts store.  While your autoparts store now has most everything in stock, and rarely needs to make on-demand orders from the factory. 

So even though you can get a really fast mechanic.  He can't install parts he doesn't have in stock.  This is why the Clock speeds have dropped considerably.  Its normal to see chips with only 1-2 Ghz ( slower mechanics ) but with more cache.  Today we have chips with up to 4 cores ( 4 mechanics ), and they share a 12 Meg Cache ( big inventory ).  When buying a new computer make sure your focus in on the amount of Cache on the chip, rather than clock speed.  A shared Cache means all your cores have access to your cache.  If you have a chip that is setup as 2 x 4 Meg Cache this usually means each core has its own 4 Meg Cache, and it doesnt have access to the other core's cache.  Which is better Shared or Dedicated Cache is a heavily debated topic amoung computer people. The truth is depending what software you are running will impact which will benefit you the most.  But for most users that aren't running Enteprise level Applications ( SAP, Databases, Server Soft ), you will notice very little difference between the two cache models. What is important is to get as much cache as you can.  Don't worry about the clock speed so much.

The marketing model for Most chips today is very fuzzy to consumers.  If you don't know your stuff, you will most likely buy a computer based on price and looks.  The new Branding of Intel  from the traditional Pentium series, to the M, Core2, Core2 duo, Xeon, Quad Core, and then AMD's great names like Athlon, Phenom, Opteron.  Leave consumers unable to know what is best buy the name alone.  Consumers have more confidence in buying based on Brand ( Dell, HP, Sony, IBM ) rather than the CPU brand or model.  Intel is still by far the leader in CPUs.  Even though the AMDs are very good values for the money, they still can't touch Intel's performance.  Intel has better reliability, and better performance.  I have a buddy that went through 3 AMD chips of which all had problems, before finally switching over to intel.  Ever since the switch he hasn't had a single issue. 




Permalink
2022 Visitors
2022 Views

Categories associated with What is Cache

Discussion

No Comments have been submitted
name
Email Needed to confirm comment, but not made public.
Website
 
 
When you Post your Comment, you'll be sent a confirmation link. Once you click this link your thoughts will be made public.. Posts that are considered spam will be deleted, Please keep your thoughts and links relavent to this Article