Oba-Q's Free Space >  パソコン > UnixBench

UnixBench

本日は小雨が夕方には叩きつけるような大粒の
雨に変わりました。
最高気温も18度程度までしか上がらず、現在は
15度を切っているかも。。。

UnixBench

先日コマンドでディスクのベンチマークを行ったのは
fioでしたが、CPUのベンチマークはないんかい?という
ご質問がありました。
コマンドでやるベンチマークと言えばやはり伝統的な
UnixBencchでしょう。

UnixBencchソースコードからビルドするところから
始まるため、環境を整えておかなくてはいけません。
build-essentialをインストールすれば、以下の
依存関係にあるものの不足分も入ります。
dpkg-dev・g++・gcc・libc6-dev・make

$sudo apt-get install build-essential

UnixBenchはGitHubで公開されているので
$ git clone https://github.com/kdlucas/byte-unixbench.git .
これで落ちてきます。

gitツールがインストールされていなければ
$sudo apt-get install git
でインストールしておきますます。

ベンチマークの実行

ダウンロードしたディレクトリに入り込んで実行します。

$ cd UnixBench
$ ./Run

実行させるとナニヤラ小1時間程怪しいことやってます。w

gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c
gcc -o pgms/register -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=’register int’ src/arith.c
gcc -o pgms/short -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=short src/arith.c
gcc -o pgms/int -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=int src/arith.c
gcc -o pgms/long -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=long src/arith.c
gcc -o pgms/float -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=float src/arith.c
gcc -o pgms/double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Ddatum=double src/arith.c
gcc -o pgms/hanoi -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/hanoi.c
gcc -o pgms/syscall -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/syscall.c
gcc -o pgms/context1 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/context1.c
gcc -o pgms/pipe -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/pipe.c
src/pipe.c: In function ‘main’:
src/pipe.c:52:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
pipe(pvec);
^~~~~~~~~~
gcc -o pgms/spawn -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/spawn.c
gcc -o pgms/execl -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/execl.c
In file included from src/execl.c:34:0:
src/big.c: In function ‘dummy’:
src/big.c:109:5: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result [-Wunused-result]
freopen(“masterlog.00”, “a”, stderr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/big.c:197:6: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result [-Wunused-result]
freopen(logname, “w”, stderr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/big.c:221:3: warning: ignoring return value of ‘dup’, declared with attribute warn_unused_result [-Wunused-result]
dup(pvec[0]);
^~~~~~~~~~~~
src/big.c:225:6: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result [-Wunused-result]
freopen(logname, “w”, stderr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/big.c:318:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(fcopy, cp->line, p – cp->line + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/big.c:196:34: warning: ‘%02d’ directive writing between 2 and 10 bytes into a region of size 5 [-Wformat-overflow=]
sprintf(logname, “masterlog.%02d”, firstuser/MAXCHILD);
^~~~
src/big.c:196:23: note: directive argument in the range [-178956970, 178956970]
sprintf(logname, “masterlog.%02d”, firstuser/MAXCHILD);
^~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
from src/execl.c:25:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 13 and 21 bytes into a destination of size 15
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL – 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -o pgms/dhry2 -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/dhry2reg -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DHZ= -DREG=register ./src/dhry_1.c ./src/dhry_2.c
gcc -o pgms/looper -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/looper.c
gcc -o pgms/fstime -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME src/fstime.c
gcc -o pgms/whetstone-double -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -DDP -DGTODay -DUNIXBENCH src/whets.c -lm
make all
make[1]: Entering directory ‘/home/mainte/unixbench/UnixBench’
make distr
make[2]: Entering directory ‘/home/mainte/unixbench/UnixBench’
Checking distribution of files
./pgms exists
./src exists
./testdir exists
./tmp exists
./results exists
make[2]: Leaving directory ‘/home/mainte/unixbench/UnixBench’
make programs
make[2]: Entering directory ‘/home/mainte/unixbench/UnixBench’
make[2]: Nothing to be done for ‘programs’.
make[2]: Leaving directory ‘/home/mainte/unixbench/UnixBench’
make[1]: Leaving directory ‘/home/mainte/unixbench/UnixBench’
sh: 1: 3dinfo: not found

# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #

Version 5.1.3 Based on the Byte Magazine Unix Benchmark

Multi-CPU version Version 5 revisions by Ian Smith,
Sunnyvale, CA, USA
January 13, 2011 johantheghost at yahoo period com

——————————————————————————
Use directories for:
* File I/O tests (named fs***) = /home/mainte/unixbench/UnixBench/tmp
* Results = /home/mainte/unixbench/UnixBench/results
——————————————————————————

Wide character in print at ./Run line 1643.
Wide character in printf at ./Run line 1674.

1 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput 1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks 1 2 3

1 x File Copy 256 bufsize 500 maxblocks 1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks 1 2 3

1 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10

1 x Process Creation 1 2 3

1 x System Call Overhead 1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent) 1 2 3

1 x Shell Scripts (8 concurrent) 1 2 3
Wide character in printf at ./Run line 1574.

4 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10

4 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10

4 x Execl Throughput 1 2 3

4 x File Copy 1024 bufsize 2000 maxblocks 1 2 3

4 x File Copy 256 bufsize 500 maxblocks 1 2 3

4 x File Copy 4096 bufsize 8000 maxblocks 1 2 3

4 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10

4 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10

4 x Process Creation 1 2 3

4 x System Call Overhead 1 2 3 4 5 6 7 8 9 10

4 x Shell Scripts (1 concurrent) 1 2 3

4 x Shell Scripts (8 concurrent) 1 2 3
Wide character in printf at ./Run line 1574.

都度ソースコードをビルドしながらベンチマークを
実行するってなんともUnixらしいじゃありませんか。(笑
実行中のパソはそこそこ発熱するので、それなりの
負荷をかけているのでしょう。

実行例はCPU Core i5-2400 という古いもので
Youtubeの動画を再生させながらのベンチマークです。
だって、退屈なんだもの。。。w
で、結果は・・・

========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)

System: giga-ubuntu: GNU/Linux
OS: GNU/Linux — 4.18.0-25-generic — #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap=”UTF-8″, collate=”UTF-8″)
CPU 0: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (6185.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 1: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (6185.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 2: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (6185.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 3: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (6185.5 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
13:17:55 up 32 min, 1 user, load average: 0.13, 0.36, 0.41; runlevel 2019-07-11

————————————————————————
Benchmark Run: 木 7月 11 2019 21:17:55 – 21:46:07
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 39137209.3 lps (10.0 s, 7 samples)
Double-Precision Whetstone 4423.6 MWIPS (10.7 s, 7 samples)
Execl Throughput 4468.2 lps (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 607589.6 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 162558.9 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1711419.1 KBps (30.0 s, 2 samples)
Pipe Throughput 814228.3 lps (10.0 s, 7 samples)
Pipe-based Context Switching 185930.7 lps (10.0 s, 7 samples)
Process Creation 7674.9 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 7135.8 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 2894.0 lpm (60.0 s, 2 samples)
System Call Overhead 505652.3 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 39137209.3 3353.7
Double-Precision Whetstone 55.0 4423.6 804.3
Execl Throughput 43.0 4468.2 1039.1
File Copy 1024 bufsize 2000 maxblocks 3960.0 607589.6 1534.3
File Copy 256 bufsize 500 maxblocks 1655.0 162558.9 982.2
File Copy 4096 bufsize 8000 maxblocks 5800.0 1711419.1 2950.7
Pipe Throughput 12440.0 814228.3 654.5
Pipe-based Context Switching 4000.0 185930.7 464.8
Process Creation 126.0 7674.9 609.1
Shell Scripts (1 concurrent) 42.4 7135.8 1683.0
Shell Scripts (8 concurrent) 6.0 2894.0 4823.3
System Call Overhead 15000.0 505652.3 337.1
========
System Benchmarks Index Score 1166.1

————————————————————————
Benchmark Run: 木 7月 11 2019 21:46:07 – 22:14:12
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables 146530868.7 lps (10.0 s, 7 samples)
Double-Precision Whetstone 18139.3 MWIPS (10.0 s, 7 samples)
Execl Throughput 15062.3 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 1317196.0 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 351771.7 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 3440078.5 KBps (30.0 s, 2 samples)
Pipe Throughput 2824320.8 lps (10.0 s, 7 samples)
Pipe-based Context Switching 671813.0 lps (10.0 s, 7 samples)
Process Creation 29358.3 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 20539.3 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 3186.7 lpm (60.0 s, 2 samples)
System Call Overhead 1663949.3 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 146530868.7 12556.2
Double-Precision Whetstone 55.0 18139.3 3298.1
Execl Throughput 43.0 15062.3 3502.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 1317196.0 3326.3
File Copy 256 bufsize 500 maxblocks 1655.0 351771.7 2125.5
File Copy 4096 bufsize 8000 maxblocks 5800.0 3440078.5 5931.2
Pipe Throughput 12440.0 2824320.8 2270.4
Pipe-based Context Switching 4000.0 671813.0 1679.5
Process Creation 126.0 29358.3 2330.0
Shell Scripts (1 concurrent) 42.4 20539.3 4844.2
Shell Scripts (8 concurrent) 6.0 3186.7 5311.1
System Call Overhead 15000.0 1663949.3 1109.3
========
System Benchmarks Index Score 3278.6

こんな感じです。
ご紹介しても多分使いそうにないので詳細な説明は
割愛させていただきます。ww
というか拙生はベンチマークをあまりやらないし、
やっても結果で重要と思われるいくつかの項目しか
見ないので正直拙生自身もあまり詳しくはないのですよ。。

他にはGeekbenchなんてのもありますがトライアウトモードで
結果はサーバーに送信され、結果をweb経由で見に行くのが
なんだか気持ちが悪くて使ったことはありません。

GUIでイイのないんかいとも尋ねられましたので
phoronix-test-suiteをご案内しておきました。

This entry was posted in パソコン. Bookmark the permalink.

Comments are closed.