Windows 10 20H1 Build 18917のWSL2でUnixBenchとってみた

まずWSL1の状態でベンチを動かしたあと、WSL2に変換して再実行しました。

環境は古いノートPC＋SSDです。

# WSL1

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

   System: DESKTOP-MTEHMSF: GNU/Linux
   OS: GNU/Linux -- 4.4.0-18917-Microsoft -- #1000-Microsoft Fri Jun 07 19:42:00 PST 2019
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (5002.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 1: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (5002.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 2: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (5002.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 3: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (5002.0 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   22:55:07 up 59 min,  0 users,  load average: 0.52, 0.58, 0.59; runlevel

------------------------------------------------------------------------
Benchmark Run: Thu Jun 13 2019 22:55:07 - 23:23:21
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       34864987.6 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     4361.4 MWIPS (9.9 s, 7 samples)
Execl Throughput                                262.1 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks         70776.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           18227.2 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        221085.4 KBps  (30.0 s, 2 samples)
Pipe Throughput                              217786.2 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  31918.0 lps   (10.0 s, 7 samples)
Process Creation                                429.6 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                    688.9 lpm   (60.1 s, 2 samples)
Shell Scripts (8 concurrent)                    126.3 lpm   (60.6 s, 2 samples)
System Call Overhead                         271501.6 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   34864987.6   2987.6
Double-Precision Whetstone                       55.0       4361.4    793.0
Execl Throughput                                 43.0        262.1     61.0
File Copy 1024 bufsize 2000 maxblocks          3960.0      70776.2    178.7
File Copy 256 bufsize 500 maxblocks            1655.0      18227.2    110.1
File Copy 4096 bufsize 8000 maxblocks          5800.0     221085.4    381.2
Pipe Throughput                               12440.0     217786.2    175.1
Pipe-based Context Switching                   4000.0      31918.0     79.8
Process Creation                                126.0        429.6     34.1
Shell Scripts (1 concurrent)                     42.4        688.9    162.5
Shell Scripts (8 concurrent)                      6.0        126.3    210.5
System Call Overhead                          15000.0     271501.6    181.0
                                                                   ========
System Benchmarks Index Score                                         195.9

------------------------------------------------------------------------
Benchmark Run: Thu Jun 13 2019 23:23:21 - 23:51:54
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables       55181887.6 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                    11634.6 MWIPS (9.8 s, 7 samples)
Execl Throughput                                472.1 lps   (29.6 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks         51705.7 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           13391.1 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        171441.3 KBps  (30.0 s, 2 samples)
Pipe Throughput                              413731.6 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 123267.0 lps   (10.0 s, 7 samples)
Process Creation                                675.0 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                    813.5 lpm   (60.1 s, 2 samples)
Shell Scripts (8 concurrent)                    103.9 lpm   (61.2 s, 2 samples)
System Call Overhead                         597742.5 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   55181887.6   4728.5
Double-Precision Whetstone                       55.0      11634.6   2115.4
Execl Throughput                                 43.0        472.1    109.8
File Copy 1024 bufsize 2000 maxblocks          3960.0      51705.7    130.6
File Copy 256 bufsize 500 maxblocks            1655.0      13391.1     80.9
File Copy 4096 bufsize 8000 maxblocks          5800.0     171441.3    295.6
Pipe Throughput                               12440.0     413731.6    332.6
Pipe-based Context Switching                   4000.0     123267.0    308.2
Process Creation                                126.0        675.0     53.6
Shell Scripts (1 concurrent)                     42.4        813.5    191.9
Shell Scripts (8 concurrent)                      6.0        103.9    173.2
System Call Overhead                          15000.0     597742.5    398.5
                                                                   ========
System Benchmarks Index Score                                         281.7
```

# WSL2

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

   System: DESKTOP-MTEHMSF: GNU/Linux
   OS: GNU/Linux -- 4.19.43-microsoft-standard -- #1 SMP Mon May 20 19:35:22 UTC 2019
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (4988.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 1: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (4988.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 2: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (4988.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   CPU 3: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (4988.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   02:12:55 up 0 min,  0 users,  load average: 0.04, 0.01, 0.00; runlevel

------------------------------------------------------------------------
Benchmark Run: Fri Jun 14 2019 02:12:55 - 02:41:01
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       33880708.3 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     4313.9 MWIPS (9.9 s, 7 samples)
Execl Throughput                               3791.7 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        530306.9 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          104802.5 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1575922.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                              790148.5 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  11518.4 lps   (10.0 s, 7 samples)
Process Creation                               4462.8 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   7035.5 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1574.0 lpm   (60.0 s, 2 samples)
System Call Overhead                         570331.7 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   33880708.3   2903.2
Double-Precision Whetstone                       55.0       4313.9    784.4
Execl Throughput                                 43.0       3791.7    881.8
File Copy 1024 bufsize 2000 maxblocks          3960.0     530306.9   1339.2
File Copy 256 bufsize 500 maxblocks            1655.0     104802.5    633.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    1575922.7   2717.1
Pipe Throughput                               12440.0     790148.5    635.2
Pipe-based Context Switching                   4000.0      11518.4     28.8
Process Creation                                126.0       4462.8    354.2
Shell Scripts (1 concurrent)                     42.4       7035.5   1659.3
Shell Scripts (8 concurrent)                      6.0       1574.0   2623.4
System Call Overhead                          15000.0     570331.7    380.2
                                                                   ========
System Benchmarks Index Score                                         778.6

------------------------------------------------------------------------
Benchmark Run: Fri Jun 14 2019 02:41:01 - 03:09:25
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables       40715860.9 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                    11363.7 MWIPS (10.1 s, 7 samples)
Execl Throughput                               7159.2 lps   (29.6 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        654775.8 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          175768.1 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1960394.1 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1680014.6 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 241063.7 lps   (10.0 s, 7 samples)
Process Creation                              12042.2 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                  10894.4 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1537.7 lpm   (60.2 s, 2 samples)
System Call Overhead                        1492058.5 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   40715860.9   3488.9
Double-Precision Whetstone                       55.0      11363.7   2066.1
Execl Throughput                                 43.0       7159.2   1664.9
File Copy 1024 bufsize 2000 maxblocks          3960.0     654775.8   1653.5
File Copy 256 bufsize 500 maxblocks            1655.0     175768.1   1062.0
File Copy 4096 bufsize 8000 maxblocks          5800.0    1960394.1   3380.0
Pipe Throughput                               12440.0    1680014.6   1350.5
Pipe-based Context Switching                   4000.0     241063.7    602.7
Process Creation                                126.0      12042.2    955.7
Shell Scripts (1 concurrent)                     42.4      10894.4   2569.4
Shell Scripts (8 concurrent)                      6.0       1537.7   2562.8
System Call Overhead                          15000.0    1492058.5    994.7
                                                                   ========
System Benchmarks Index Score                                        1634.3
```

4多重のProcess Creationはたしかにおよそ20倍は早くなっていますね。

それと、4多重のFile Copy 256 bufsize 500 maxblocksが13倍ぐらいでしょうか？

一方で、1多重のPipe-based Context Switchingは1/3ぐらいに遅くなってたりもします。