linuxのマシンのベンチマークを前からしたかったので少し調べた。
https://goto-linux.com/ja/2020/5/11/linux%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%81%AE%E3%83%98%E3%83%B3%E3%83%81%E3%83%9E%E3%83%BC%E3%82%AF%E6%96%B9%E6%B3%95/
を参考にすると、sysbenchというのがいいかも。
https://goto-linux.com/ja/2020/5/11/linux%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%81%AE%E3%83%98%E3%83%B3%E3%83%81%E3%83%9E%E3%83%BC%E3%82%AF%E6%96%B9%E6%B3%95/
を参考にすると、sysbenchというのがいいかも。
例えばラズパイ3
pi@raspberrypi3:~ $ sysbench --test=cpu run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 10000
Test execution summary:
total time: 143.1445s
total number of events: 10000
total time taken by event execution: 143.1392
per-request statistics:
min: 14.28ms
avg: 14.31ms
max: 39.76ms
approx. 95 percentile: 14.34ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 143.1392/0.00
よくわからんが、total time taken by event executionを見るんだとすると、143.1秒である。
ラズパイ1だとこれが349.1秒になる。
で、ラズパイ4のubuntuで同じことをやったが、バージョンが違って結果の表示が異なる。
lucy@raspberrypi4:~$ sysbench --test=cpu run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Prime numbers limit: 10000
Initializing worker threads...
Threads started!
CPU speed:
events per second: 1485.10
General statistics:
total time: 10.0006s
total number of events: 14858
Latency (ms):
min: 0.67
avg: 0.67
max: 1.44
95th percentile: 0.68
sum: 9993.97
Threads fairness:
events (avg/stddev): 14858.0000/0.00
execution time (avg/stddev): 9.9940/0.00
どうも、events per secondが速さらしい。この場合、1485.10である。ラズパイ3(RaspbianOS)の場合もイベントの数とそれにかかった時間が最後の2行に出力されているので、割り算をしてみると、100000/143.1392=698.62になる。ラズパイ4のほぼ1/2である。ラズパイ1で同様の計算をすると、100000/349.0777=286.47となり、ラズパイ3の4割程度、ラズパイ4の2割ということになる。
では、core2duoを搭載した古いノートパソコン(Dyanbook SS/RX2)ではどうか。OSはXubuntuであるが、結果は516.56。ラズパイ3より遅い。
ところが確か第2世代のcorei3のノートPC(Dynabook R632)では497.73となりcore2duoより遅い。こいつのOSはUbuntu20.04である。う?
さらに、lenovoのデスクトップ上のVirtualBox上で動かしたubuntu20.04では1031.52とあまり速くない。これならラズパイ4のほうが速いが、本当か?