Thursday, October 14, 2010

Picking the correct laptop processor, in a nutshell

Picking the correct processor when buying a laptop or a desktop machine gets unnecessarily complicated due to marketing campaigns conducted by major CPU manufacturers, not many but Intel. We often try to buy one of the top range processors to be future proof or rather be on the edge, not knowing the requirements or actual usage. This often results being silly at the end of the day. Let's try to understand some of the features what mobile processors offer in general.

Processor cache:
Intel processors often talk about the processor cache. It doesn't play a big role anyways. The AMD processors in general doesn't rely on the processor cache but thick pipelines to fetch data between main memory and the processor. Let's take a look at the pros and cons of processor cache.

Processor cache can be explained this way. Imagine a public library. Where does the librarian keep frequently accessed publications ? Probably on the librarian's table, take this as Level 1 (L1) cache in a processor. The less frequent publications are kept on the drawer, consider this being Level 2 (L2) cache. As you know, the librarian could keep just a handful number of publications with him/her. The rest of the publications must go into the locked cupboards, this is the main memory.

This has both good and bad. The good is, the librarian doesn't have to access locked cupboards to offer frequently accessed publications when they're on his table. The information can be accessed and serve upon requests very quickly. This is the good side of having a larger cache.

But how about when someone requests a publication which doesn't exist on his table (L1 cache) or in the drawer (L2 cache) ? He has to get this book from the locked cupboard. So the time that the librarian has spent on searching for publications at his desk and in the drawer are an utter waste. This is the downside of processor cache.

Intel processor cache:
Intel processors have a smaller L1 cache, which has redundant data in Level L2 cache. They call this approach "inclusive" principle. The downside is not just the redundant data in L2 cache, but also the replicated data won't be accessed as expected. The advantage of this approach is, the data requires to be updated at the L2 cache.

AMD processor cache:
AMD follows the opposite, which is the "exclusive" principle. The AMD L1 cache data won't get duplicated in L2 cache for it's costly given the size. AMD's L1 caches are quite big compared to Intel's. AMD processors have large L1 caches starting from 128kb,  so it does make sense for them to have this "exclusive" approach.

CPU Cache
MakeModel# CoresSpeedL1 CacheL2 CacheL3 Cache
AMDN 93042GHz512 kb2048 kb-
Inteli7-720QM41.6 GHz - 2.8GHz (Turbo Boost)256 kb1024 kb6144 kb

Source :

Pros and cons of AMD/Intel approach:
The CPU cache becomes very handy when you run an application which requires to store data and access them quite frequently. For an example, a word processing application can be given. However, a bigger cache doesn't make any sense if you're performing a task, which doesn't cache information for later retrieval. An encoding decoding application is a better example for this. When you rip an Audio CD to MP3 format, it doesn't refer or access the cached data over a period of time. A larger cache becomes pretty much ineffective in this scenario.

I forgot to mention, why we require a processor cache. The main memory modules are pretty slow, catering the demand what the processor has. So having a processor cache appeared the best solution for this issue to minimise round-trips to the main memory.

Memory access speeds:
The AMD processors are the least to suffer from this, given the high bandwidth they have between processor and the main memory. AMD doesn't heavily rely on processor caches, given the bandwidth it has. Let's get some facts :

CPU Comparison
MakeModel# CoresClock SpeedMax Memory BandwidthI/O Bus SpeedTDP
AMDN 93042GHz35.7 GB/s3.6 GT/s35W
Inteli7-720QM41.6 GHz - 2.8GHz (Turbo Boost)21 GB/s2.5 GT/s45W

Source :

Processor speed :
In a nutshell, none of the processors in the market run at its optimal marked clock speed. For an example, if you take a look at a processor marked at 2GHz it starts hitting the 2 GHz mark ONLY when you run processor intensive operations. Actually this is govern by the operating system + processor. The processor informs the min and max clock speeds to the operating system. Which defines and dictates what's the clock speed should be, based on the load. Which means, the operating system uses this information to increase the clock speed on demand.(based on the enforced cpu policy)

Even though you have the best processor in the market with having a very high clock speed, what if your system doesn't hit the line ? What if you don't require that much horsepower ? It's an utter waste of money and resources. You've been just bullied by processor manufacturers ;-) Which is the ultimate truth, the reality. If you have an Intel i7 840QM processor and just uses it at 1100Hz at 90% of the time, what does it mean to pay extra $$$$ for ? You would have achieved your tasks with a lower end processor without any lagging while saving some big $$$.

Let's get some facts right. I'm using and AMD QuadCore N930 2 GHz Quad Core processor. I'm using Debian Squeeze, the it reads following CPU stepping speeds 2.0 GHz , 1.7 GHz, 1.4 GHz, 1.1 GHz and 800Hz. I ran following applications during this test  :

  • Eclipse with JBossTools 3.x
  • Netbeans 6.9.1
  • PostgreSQL 8. database server
  • MySQL 5.1x
  • JBoss-5.1 Application server
  • HornetQ JMS broker
  • Linux shell
  • Galeon web browser with multiple tabs
  • Iceweasel web browser with multiple tabs
  • Skype
  • Pidgin (MSN/Yahoo/GTalk)
  • gedit
  • File browser
  • SSH and the default system services

During one of the busiest days, my CPU statistics read as follows :

CPU Usage
Core# Usage @ 2.0 GHz Usage @ 1.7 GHz Usage @ 1.4 GHz Usage @ 1.1 GHz Usage @ 800 Hz
0 2.59% 0.08% 0.13% 0.27% 96.94%
1 2.53% 0.09% 0.17% 0.15% 97.06%
2 2.89% 0.10% 0.14% 0.15% 96.73%
3 2.55% 0.10% 0.12% 0.15% 97.08%
Total CPU usage 2.64% 0.09% 0.14% 0.18% 96.95%

Common properties for all cores :
hardware limits: 800 MHz - 2.00 GHz
driver: powernow-k8
available frequency steps: 2.00 GHz, 1.70 GHz, 1.40 GHz, 1.10 GHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 2.00 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.

Even though you have the fastest processor in the world, it doesn't mean anything if the applications you run don't require that much power. What's the point spending bug $$$ on high end processors ? To make processor manufacturers rich ?

Intel's hyper threading :
Intel's two threads per core mechanism doesn't scale really well in some aspects, as you already aware each thread requires a CPU cycle. This has some concerns when dealing with large caches, known as cache pollution. Besides security, the power consumption has proven to be high as well. Although Intel claims a 30% performance boot, the downside takes its gloss away.

WTF ? Then, how come Intel outperforms AMD on certain laptop models ?
Fair enough, how does the Intel's i7s outperform AMD's QuadCore then ? Just one word, simply by "over-clocking". Intel calls this 'Turbo Boost', quite strangely. I managed to get my hands on a Dell laptop, which carries an i7 720QM processor. It worked well for a while, but not when I started to run some heavy processor intensive applications. Needless to mention the overheat it generates, when it gets into the turbo boost mode. The overheat often throttles the clock speed to run down. This 45W watts processor, promised to deliver goods under load at 2.8GHz (on demand) but sadly I've experienced the opposite. The usual story I've suffered with their older Core2Duo family processors continues. The clock speed went down to cope with the overheat. I was not alone :,macbook-pro-helps-core-i7-hit-100-degrees.aspx

No comments:

Post a Comment