Androidスマホでunixbenchを走らせる

Android に linux をインストール

UserLAnd - Google Play のアプリ
https://play.google.com/store/apps/details?id=tech.ula&hl=ja

userland で linux を入れるとポート番号 2022 で ssh ログインができるようになります。

下記アプリなどを使用して 192.168 から始まる IP アドレスを確認します。

IP Tools: WiFi Analyzer - Google Play のアプリ
https://play.google.com/store/apps/details?id=com.ddm.iptools&hl=ja

適当なPCからAndroidへSSHログインを行う

````
ssh username@192.168.xxx.xxx -p 2022 ;
````

unixbench のインストール

~~~~
sudo apt-get update ;
sudo apt-get install git ;
sudo apt-get install build-essential ;
git clone https://github.com/kdlucas/byte-unixbench.git ;
~~~~

実行

~~~~
cd byte-unixbench/UnixBench
./Run
~~~~

実行結果（１時間くらいはかかる）

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

   System: localhost: GNU/Linux
   OS: GNU/Linux -- 4.4.95 -- #2 SMP PREEMPT Thu Mar 21 15:55:41 CST 2019
   Machine: aarch64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   ; runlevel 

------------------------------------------------------------------------
Benchmark Run: Sat Sep 05 2020 10:31:39 - 11:06:43
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        2942361.1 lps   (21.3 s, 7 samples)
Double-Precision Whetstone                      676.1 MWIPS (13.7 s, 7 samples)
Execl Throughput                                 66.8 lps   (30.1 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks         95718.8 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           27370.4 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        287210.1 KBps  (30.0 s, 2 samples)
Pipe Throughput                              156667.4 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  33218.1 lps   (10.0 s, 7 samples)
Process Creation                               1144.9 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                    737.4 lpm   (60.1 s, 2 samples)
Shell Scripts (8 concurrent)                    146.4 lpm   (60.3 s, 2 samples)
System Call Overhead                           9449.7 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    2942361.1    252.1
Double-Precision Whetstone                       55.0        676.1    122.9
Execl Throughput                                 43.0         66.8     15.5
File Copy 1024 bufsize 2000 maxblocks          3960.0      95718.8    241.7
File Copy 256 bufsize 500 maxblocks            1655.0      27370.4    165.4
File Copy 4096 bufsize 8000 maxblocks          5800.0     287210.1    495.2
Pipe Throughput                               12440.0     156667.4    125.9
Pipe-based Context Switching                   4000.0      33218.1     83.0
Process Creation                                126.0       1144.9     90.9
Shell Scripts (1 concurrent)                     42.4        737.4    173.9
Shell Scripts (8 concurrent)                      6.0        146.4    243.9
System Call Overhead                          15000.0       9449.7      6.3
                                                                   ========
System Benchmarks Index Score                                         107.6

------------------------------------------------------------------------
Benchmark Run: Sat Sep 05 2020 11:06:43 - 11:41:19
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables       29628799.0 lps   (10.1 s, 7 samples)
Double-Precision Whetstone                     6900.9 MWIPS (9.7 s, 7 samples)
Execl Throughput                                370.9 lps   (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        258059.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           70837.5 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        756340.5 KBps  (30.0 s, 2 samples)
Pipe Throughput                              612914.4 lps   (10.1 s, 7 samples)
Pipe-based Context Switching                 128778.2 lps   (10.1 s, 7 samples)
Process Creation                               2346.7 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                    623.6 lpm   (104.6 s, 2 samples)
Shell Scripts (8 concurrent)                    148.2 lpm   (60.7 s, 2 samples)
System Call Overhead                           8292.6 lps   (24.1 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   29628799.0   2538.9
Double-Precision Whetstone                       55.0       6900.9   1254.7
Execl Throughput                                 43.0        370.9     86.3
File Copy 1024 bufsize 2000 maxblocks          3960.0     258059.2    651.7
File Copy 256 bufsize 500 maxblocks            1655.0      70837.5    428.0
File Copy 4096 bufsize 8000 maxblocks          5800.0     756340.5   1304.0
Pipe Throughput                               12440.0     612914.4    492.7
Pipe-based Context Switching                   4000.0     128778.2    321.9
Process Creation                                126.0       2346.7    186.2
Shell Scripts (1 concurrent)                     42.4        623.6    147.1
Shell Scripts (8 concurrent)                      6.0        148.2    247.0
System Call Overhead                          15000.0       8292.6      5.5
                                                                   ========
System Benchmarks Index Score                                         302.8

~~~~

最近のスマホはマルチコアなのでいい感じにマルチスレッドを使えると思いたい。