Ubuntu and processor speed detection

Solution 1:

By default Ubuntu uses the ondemand frequency governor. To check/switch governors, install the cpufrequtils package like this:

sudo apt-get install cpufrequtils

To check the current speed/governors of each core run:

cpufreq-info

You can set all cores to performance like this:

sudo cpufreq-set -r -g performance

You can confirm that all cores are now running at their max frequency like this:

grep MHz /proc/cpuinfo

Note: this change is temporary. Once you reboot, it'll be back to ondemand.

Solution 2:

Theoretical background: In a typical computer, the CPU is idle most of the time. To save power, modern CPUs implement frequency scaling - i.e. the operating system can tell the CPU to switch to lower frequency when the load is low. The technology is called SpeedStep in Intel processors and Cool'n'Quiet in AMD processors.

In Linux kernel frequency scaling is implemented by cpufreq infrastructure, which uses a concept of "governors" to control the frequency.

The default governor is "ondemand", which increases the frequency once the processor utilisation raises above 95%. This allows CPU to save some power while idle yet to switch to full performance when there are things to do. There is some transition latency, measured in milliseconds, so when an idle CPU suddenly gets a big load it continues to chug at low frequency for a few milliseconds before switching to full power, so in certain situation this may result in slightly lower performance than when always running at full speed.

There are other governors, including the "performance" governor which always runs the CPU at its full frequency. This eliminates the switching latency, but may increase power consumption.

You may experiment with different governors as suggested in another answer, but I doubt it will produce dramatic results. They wouldn't make it a default unless it made sense in 99% of cases :)

Back to your question, though: most likely, Windows shows you the maximum possible CPU frequency (the one they advertise on the CPU's box), while Ubuntu shows you the actual frequency each of the CPU cores runs with at this particular moment. It does not mean that the CPU runs slower in Ubuntu. If it appears that Ubuntu runs slow on your laptop it most likely is caused by something else - for example, low RAM, slow hard drive etc. Modern Ubuntu certainly requires more resources than, say, Windows XP which you're likely to find on an older laptop.

More technical reading:

  • Using CPUfreq Governors
  • CPU frequency and voltage scaling code in the Linux(TM) kernel