20081010 advent cycles

From s5h.net

Jump to: navigation, search

Something I keep reading on the net about the advent 4211 is the battery life (and I myself have commented on this). Since the netbook is mostly waiting on IO, why not tune the CPU cycles down a little? Here is a script that will obviously do just that should you want to hook this into a on battery state then you have my blessing:

for i in 0 1 ; do cpufreq-selector -c $i -f 50000 ; done ;

(Of course that should be changed if you have four processors and so on). Why not test this against the random number generator to see what performance you’re likely to get from the processor:

root@ed-loptap:~# for i in 0 1 ; do cpufreq-selector -c $i -f 1600000 ; done ;
root@ed-loptap:~# dd if=/dev/random of=/dev/null bs=8192 count=1
0+1 records in
0+1 records out
128 bytes (128 B) copied, 0.000293412 s, 436 kB/s
root@ed-loptap:~# for i in 0 1 ; do cpufreq-selector -c $i -f 50000 ; done ;
root@ed-loptap:~# dd if=/dev/random of=/dev/null bs=8192 count=1
0+1 records in
0+1 records out
128 bytes (128 B) copied, 0.000589757 s, 217 kB/s

From what I can see from this, it doesn’t look as though the CPU freq is a linear scale, that is, the rating doesn’t match the performance. There are probably other factors at play here such as the memory bus and other parts of the system that are going to be operating normally despite the CPU cycle degradation.

Something else that I noticed about the Sun Blade “64″ bit boxes that I was using at the training centre is that their CPU integer (at least the OS integer) was 32 bits, a far cry from the PA boxes of many years ago that have 64 bit integers. You might also recall from earlier posts here that the amd_64 linux also has 32 bit integers. Both systems report that long int, long long, and long long int are 64 bits however. For anyone who works with C should be aware that int might vary in size from build to build - but it’s almost safe to bet that it’s going to be 32 bits.

Personal tools
Google AdSense