Walt Mankowski via plug on 12 Dec 2021 14:42:26 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] CPU Scaling


Hi,

As usual in December I've been working my way through the awesome Advent of Code problems. (This year we're saving Christmas by riding around in a submarine. Don't ask.)

While working on today's problem I noticed that my code ran about twice as fast on my Apple laptop than my Ubuntu desktop, despite the fact that my desktop's CPUs are over 50% faster (3.5 GHz AMD vs 2.3 GHz Intel Core i7). When I looked in /proc/cpuinfo I saw that the "cpu MHz" field was only 1400!

I did some searches online and discovered this seems to be due to something called "CPU Scaling". I've looked at /proc/cpuinfo subsequently and I've also run cpufreq-info(1) and the numbers vary quite a bit. I'm guessing the system is dynamically adjusting the CPU speed based on the current system load.

I've never noticed this before so I don't know if it's been in effect for a while, or if it's something new in Ubuntu 21.10. I'm not sure yet if I want to keep it or turn it off, but I would like to know more about where it's set and how to tune it. Unfortunately most of the information I've been able to find out about it seems fairly dated and predates Ubuntu's adoption of systemd. Can anyone point me to more up to date information?

Thanks.

Walt

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug